有三个值可选:LINE_8(默认)、LINE_4LINE_AA

LINE_8最快,LINE_AA最慢
LINE_8最丑,LINE_AA最美

import cv2
import numpy as np

lineType = cv2.LINE_8
# lineType = cv2.LINE_4
# lineType = cv2.LINE_AA

img = np.zeros((420, 1000, 4), np.uint8)
cv2.putText(
    img=img,
    text='XerCis',
    org=(0, 300),
    fontFace=cv2.FONT_HERSHEY_SIMPLEX,
    fontScale=10,
    color=(0, 255, 0),
    thickness=2,
    lineType=lineType)
cv2.imshow('LINE_8', img)
cv2.waitKey(0)
cv2.destroyAllWindows()

OpenCV线型lineType

OpenCV线型lineType

OpenCV线型lineType

相关文章:

  • 2021-11-15
  • 2021-04-21
  • 2022-01-13
  • 2022-02-12
  • 2022-03-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-01
  • 2021-12-24
  • 2022-12-23
  • 2021-12-27
  • 2021-11-24
  • 2021-11-13
  • 2021-05-21
相关资源
相似解决方案