OpenCV线型lineType

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

速度:LINE_8>LINE_AA
美观:LINE_AA>LINE_8

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_第1张图片

OpenCV线型lineType_第2张图片

OpenCV线型lineType_第3张图片

你可能感兴趣的:(Python,OpenCV)