Finding pixel coordinate from center of contours using python
I'm new to python and OpenCV. I just want to find the pixel coordinate of the image of the objects that has been detected by the center of contour.
Thank you in advance. Any help would be appreciated.
Through search I found something like this:
coord = np.where(np.all(img == (0, 0, 255), axis=-1))
print zip(coord[0], coord[1])
This example finds the center of an object using OpenCV with python:
http://www.pyimagesearch.com/2016/02/01/opencv-center-of-contour/
Calculate the minimal enclosing circle of the contour using cv2.minEnclosingCircle(contour)
.
Here is the documentation.
上一篇: 如何从UCI创建像“Letter Image Recognition Dataset”这样的数据图像
下一篇: 使用python从轮廓中心查找像素坐标