Hey all, I am working on image segmentation. After using watershed, I get the result shown in the first image below where the black lines indicate the boundary between regions. The result I would like to get however, should look like the second image without any black pixels (boundaries).
Currently, the way I assign boundary pixels to a region is as follows
1. loop through the entire image to look for black pixels. if it is a black pixel (boundary) then,
2. check the pixels to the right, bottom, and diagonal (right-bottom)
3. set the value of the black pixel to one of the 3 neighbors mentioned in step 2.
Would this be efficient enough ? I was hoping if could share a more efficient algorithm if the one I wrote above is not good.