怎么用python opencv连线画图?
发布网友
发布时间:2024-03-01 15:23
我来回答
共1个回答
热心网友
时间:2024-03-31 04:06
import cv2
import numpy as np
img_size = (210,210)
image = np.ones(img_size) * 255
x1 = 10
y1 =10
x2 = 200
y2 = 200
lineThickness = 2
cv2.line(image, (x1, y1), (x1, y2), (0,255,0), lineThickness)
cv2.line(image, (x1, y1), (x2, y1), (0,255,0), lineThickness)
cv2.line(image, (x1, y2), (x2, y2), (0,255,0), lineThickness)
cv2.line(image, (x2, y1), (x2, y2), (0,255,0), lineThickness)
cv2.imshow('oo',image)
cv2.waitKey()