I need to get the coordinates (center points) of the two white objects in my binary image for further processing. This is an example image:
How can I achieve this?
I am using Python and openCV
Asked
Active
Viewed 410 times
-2

michael
- 47
- 6
-
Find contours `->` Find centroids – Jeru Luke Jul 07 '22 at 07:25
-
what did you try to solve your problem ? – Yunus Temurlenk Jul 07 '22 at 07:35
-
https://stackoverflow.com/questions/49582008/center-of-mass-in-contour-python-opencv – Jeru Luke Jul 07 '22 at 08:42
1 Answers
0
It is not opencv, but you can give a try to the regionprops
method of skimage example from the docs
from skimage.measure import regionprops
for region in regionprops(yourbinary_image):
centroid = region.centroid
#do stuff with that centroid ;)

endive1783
- 827
- 1
- 8
- 18