python opencv putText
import cv2 # Load image img = cv2.imread("image.jpg") # Define text to draw text = "Hello, World!" # Define position to draw text at position = (50, 50) # Define font type, scale, color, and thickness font = cv2.FONT_HERSHEY_SIMPLEX font_scale = 1 color = (0, 0, 255) thickness = 2 # Draw text on image cv2.putText(img, text, position, font, font_scale, color, thickness) # Display image cv2.imshow("Image with Text", img) cv2.waitKey(0) cv2.destroyAllWindows()
###################
标签:putText,python,text,image,cv2,opencv,font,color From: https://www.cnblogs.com/herd/p/17297771.html