-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Closed
Description
| ( _img.channels() == 3 ) ); |
With the restriction, it's not allowed to put text on grayscale text directly.
img = np.zeros((full, full), dtype=np.uint8)
# ft.putText(img, char, textOrg, height, 255,
# thickness, 8, bottomLeftOrigin=True)
cv.putText(img, 'l', textOrg, cv.FONT_HERSHEY_SIMPLEX, 0.3, 255) # this works
The ft version fails with:
cv2.error: OpenCV(4.4.0) /private/var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T/pip-req-build-7r9u7hyj/opencv_contrib/modules/freetype/src/freetype.cpp:196: error: (-215:Assertion failed) ( _img.empty() == false ) && ( _img.isMat() == true ) && ( _img.depth() == CV_8U ) && ( _img.dims() == 2 ) && ( _img.channels() == 3 ) in function 'putText'