Answers for "cv2.putText size"

1

adding text cv2

cv2.putText (image, "text",coordinates)
Posted by: Guest on April-27-2020
0

relative text size put text cv2

def get_optimal_font_scale(text, width):
    for scale in reversed(range(0, 60, 1)):
      textSize = cv.getTextSize(text, fontFace=cv.FONT_HERSHEY_DUPLEX, fontScale=scale/10, thickness=1)
      new_width = textSize[0][0]
      #print(new_width)
      if (new_width <= width):
          return scale/10
	return 1
Posted by: Guest on November-28-2020

Python Answers by Framework

Browse Popular Code Answers by Language