The original image is
font = cv2.FONT_HERSHEY_SIMPLEX
bottomLeftCornerOfText = (10,150)
fontScale = 1
fontColor = (255,255,255)
cv2.putText(img=img,text='Hello World!',
org = bottomLeftCornerOfText,
fontFace=font,
fontScale=fontScale,
color=fontColor,
lineType=cv2.LINE_AA,
thickness=1)
After running the code above, I got image like this
Only text showed and the background image disappeared. I also tried other colors like blue and green, they all worked fine, both image and text were kept. I wonder why white text doesn't work here and how can I fix it.
Is the image type float from 0.0 to 1.0? Is it one channel grayscale? You are assigning text color with 3 channels and 255 valued... Probably you're having trouble because of one of those.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.