CH02 OpenCV-Python 기초(도형그리기)
import numpy as np import cv2 img = np.full((400, 400, 3), 255, np.uint8) cv2.line(img, (50, 50), (200, 50), (0, 0, 255), 5) cv2.line(img, (50, 60), (150, 160), (0, 0, 128)) ## ( x, y, w, h) = x, y 꼭지점으로부터 (x+w), (y+h) cv2.rectangle(img, (50, 200, 150, 100), (0, 255, 0), 2) cv2.rectangle(img, (70, 220), (180, 280), (0, 128, 0), -1) cv2.circle(img, (300, 100), 30, (255, 255, 0), -1, cv2.LINE_AA) ..
2021. 12. 18.