選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

10 行
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)