I'm working with binary images representing contours (taken through cv2.Canny
), and i want to get the coordinates of each contour clockwise, starting from the first point as intersection of the image and a horizontal line located in the center of the image. Assuming that the image i want to use is a circular contour, i would like to get something like this (assuming Y decreasing vertically, as matplotlib.pyplot.imshow
does):
I tried with the following code:
indices = numpy.where(edges == [255]) #edges is the contour image
print(indices)
But this solution sorts the coordinates from the upper side of the image. I tried other solution found on the web too, but none of them seems to be usefull for this task.