img = cv2.line(img, pt1, pt2, color, thickness, lineType)
LINE_4
, LINE_8
, LINE_AA
img = cv.rectangle(img, pt1, pt2, color, thickness, lineType)
FILLED
인 경우 안에 색칠LINE_4
, LINE_8
, LINE_AA
img = cv.circle(img, center, radius, color, thickness, lineType)
FILLED
인 경우 안에 색칠LINE_4
, LINE_8
, LINE_AA
img = cv.fillPoly(img, pts, color, lineType)
LINE_4
, LINE_8
, LINE_AA
img = cv.polylines(img, pts, isClosed, color, thickness, lineType)
LINE_4
, LINE_8
, LINE_AA
img = cv.ellipse(img, center, axes, angle, startAngle, endAngle, color, thickness, lineType)
FILLED
인 경우 색칠LINE_4
, LINE_8
, LINE_AA
img = cv.putText(img, text, org, fontFace, fontScale, color, thickness, lineType, bottomLeftOrigin)
LINE_4
, LINE_8
, LINE_AA
import numpy as np import cv2 as cv src = np.zeros((768, 1366, 3), dtype = np.uint8) cv.line(src, (100, 100), (1200, 100), (0, 0, 255), 3, cv.LINE_AA) cv.circle(src, (300, 300), 50, (0, 255, 0), cv.FILLED, cv.LINE_4) cv.rectangle(src, (500, 200), (1000, 400), (255, 0, 0), 5, cv.LINE_8) cv.ellipse(src, (1200, 300), (100, 50), 0, 90, 180, (255, 255, 0), 2) pts1 = np.array([[100, 500], [300, 500], [200, 600]]) pts2 = np.array([[600, 500], [800, 500], [700, 600]]) cv.polylines(src, [pts1], True, (0, 255, 255), 2) cv.fillPoly(src, [pts2], (255, 0, 255), cv.LINE_AA) cv.putText(src, "OpenCV", (900, 600), cv.FONT_HERSHEY_COMPLEX, 2, (255, 255, 255), 3) cv.imshow("display", src) cv.waitKey(0) cv.destroyAllWindows()