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()
'OpenCV' 카테고리의 다른 글
OpenCV - 영상 기하변환 (0) | 2022.11.07 |
---|---|
OpenCV - 차원 변경후, 이미지 생성 (0) | 2022.11.05 |
OpenCV - alpha값 조정하면서 사진 합치기 (0) | 2022.11.05 |
OpenCV - 명령키, 시스템 설계 과정 (0) | 2022.11.02 |
OpenCV - 기초 (0) | 2022.11.02 |