Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 2017-06-14 03:09:11 -0600

Nbb gravatar image

Removing the boundary after segmentation ?

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.

image description image description