0
$\begingroup$

Is there a method/algorithm to generate instances of objects from image that was segmented by the use of any image segmentation models?

For example, I have an image with one class and it was segmented in a given way, where 1s are objects of the same class and empty fields are of no class:enter image description here

How can I now generate list of the two objects, where list's elements for example would be positions of all the pixels inside the object (list of list).

$\endgroup$

1 Answer 1

0
$\begingroup$

Those segmented instances can be seen as connected components of the 1s. You can use the flood fill or BFS algorithm to detect these components or try SimpleBlobDetector by OpenCV.

$\endgroup$
1
  • 1
    $\begingroup$ "flood fill" finally worked out for me, there is a nice implementation in scikit-image library , although I had to make a loop to go through all objects, because basic implementation can only fill one "blob" of 1s at a time $\endgroup$
    – GKozinski
    Sep 1, 2021 at 10:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .