You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 年之前
12345678910
  1. import cv2
  2. from PIL import ImageFont
  3. label = ' 0.95'
  4. # fontScale=fontScale, thickness=tf
  5. text_width, text_height = cv2.getTextSize(label, 0, fontScale=1, thickness=1)[0]
  6. print(text_height)
  7. font = ImageFont.truetype("/home/th/tuo_heng/dev/AIlib2/conf/platech.ttf", 22, encoding='utf-8')
  8. x, y, width, height = font.getbbox("植被")
  9. print(x, y, width, height)