
cv2.rectangle(img, (30, 20), (270, 70), (255, 255, 255),
-1)
image = cv2.putText(img, "Raspberries!", org, font,
font_scale, color, thickness,cv2.LINE_AA)
cv2.imshow("Raspberries", image)
cv2.waitKey(0)cv2.
destroyAllWindows()
Import OpenCV.
Specifications for the text: font, coordinates of the top left cor-
ner, scale, text size, and thickness
On the image, draw a white rectangle from the coordinates (30,
20) to (270, 70) and fill it in.
On the image (on top of the white rectangle), write the text
“Raspberries!” using the preset specs.
Display the image.
Figure 9-9.
The modified raspberry photo
Instead of displaying the image on the ...