怎么用python opencv连线画图?
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了怎么用python opencv连线画图?相关的知识,希望对你有一定的参考价值。
怎么用opencv在图上点四个点,把四点连接,组成一个封闭的图形?
参考技术A import cv2import 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()
以上是关于怎么用python opencv连线画图?的主要内容,如果未能解决你的问题,请参考以下文章