我正在使用OpenCV BlobDetection来检测出现在我的网络摄像头上的blob。我正在尝试使用cv2.arrowedLine
函数从每个blob的中心到屏幕中间绘制线。你知道吗
我使用
pts = [k.pt for k in keypoints]
当我尝试使用
cv2.arrowedLine(img=frame, pt1=(centre), pt2=(int(pts)), color=(0,0,255), thickness=2)
什么都没出现。你知道吗
有解决办法吗?
非常感谢你的帮助。你知道吗
Tags:
也许先来点代码
我想你已经走了这么远。现在,当你运行以下行
pts是
[(x, y), (x, y), ... ]
形式的坐标元组列表。Opencv无法在单个点center
和点列表之间绘制箭头。因此,我们必须以for循环的形式进行检查行
pt = tuple(map(int, pt))
用于将列表中的所有数字映射为整数。仅仅调用int(list)是行不通的。你知道吗如果你再看看结果,我想这是你想要的。你知道吗
blobs before arrowsblobs with arrows
相关问题 更多 >
编程相关推荐