【发布时间】:2017-06-22 13:43:58
【问题描述】:
我是 python 和 OpenCV 的新手。我只想找到轮廓中心检测到的对象图像的像素坐标。
提前谢谢你。任何帮助将不胜感激。
通过搜索,我发现了这样的内容:
coord = np.where(np.all(img == (0, 0, 255), axis=-1))
print zip(coord[0], coord[1])
此示例使用 OpenCV 和 python 找到对象的中心:
http://www.pyimagesearch.com/2016/02/01/opencv-center-of-contour/
【问题讨论】:
-
搞笑你!!!!你是唯一一个在你的问题中提到了答案并且仍然期待答案的人
-
我不知道该把代码放在哪里..
-
在找到所有轮廓后添加。首先找到你的轮廓,然后在
for循环中运行它
标签: python-2.7 opencv numpy image-processing opencv-contour