-2

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: enter image description here How can I achieve this? I am using Python and openCV

michael
  • 47
  • 6

1 Answers1

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