No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

hace 1 año
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)