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$
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$
    – Makintosz
    Sep 1 '21 at 10:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.