【发布时间】:2018-06-03 22:25:39
【问题描述】:
我有一个元组数组:
a = [(375, 193)
(364, 113)
(277, 20)
(271, 16)
(52, 106)
(133, 266)
(289, 296)
(372, 282)]
如何在OpenCV中的点之间画线?
这是我的代码不起作用:
for index, item in enumerate(a):
print (item[index])
#cv2.line(image, item[index], item[index + 1], [0, 255, 0], 2)
【问题讨论】:
-
官方文档中有绘图教程。 docs.opencv.org/3.1.0/dc/da5/tutorial_py_drawing_functions.html - 到目前为止你尝试过什么?
-
我知道,但是教程告诉使用两点:
cv2.line(img,(0,0),(511,511),(255,0,0),5),但我有一些点 -
您还可以使用点列表绘制多边形或轮廓。你到底想达到什么目标?
-
请显示您的一些代码。如果您还没有任何编码,则很难满足 Stack Overflow 要求问题具体化的要求。
-
pointsInside =[] for index, item in enumerate(pointsInside): print (item[index]) #cv2.line(image, item[index], item[index + 1], [0, 255, 0], 2)
标签: python opencv opencv3.0 opencv-contour