Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

10 linhas
358B

  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)