OpenCV
OpenCV - 라인 그리기
import numpy as np #White 배경 생성 및 pt1 ~ pt2(RED), pt1 ~ pt3(Blue)를 잇는 선 그리기 #img = np.full((300,300,3), 255, dtype=np.uint8) img= np.zeros(shape=(512,512,3), dtype=np.uint8) +255 red=(255,0,0) blue=(0,0,255) green=(0,255,0) pt1= 0,0 pt2 =500,0 pt3 = 0,500 cv2.line(img, pt1,pt2, (red),5) #마지막은 두께 cv2.line(img, pt1,pt3, (blue), 3) cv2.imshow('img',img) cv2.waitKey() cv2.destroyAllWindows()
2022. 11. 2. 16:24