Finding completely closed boundaries in a binary image.
7 views (last 30 days)
Show older comments
hey everyone, My question is, given a binary image that consists of a boundary of white pixels which may or may not be perfectly closed. Is there a way to say with certainty that the boundary in the image is perfectly closed.
1.

2. (The one to the left)

3.

4.

The first and the second image should be calculated to be completely closed i.e any pixel inside the boundary can't be accessed by flood filling through the edges of the image. (As you can see, there is a single pixel inside the boundary in second image but that leads to the formation of two holes but still the overall boundary is closed)
And the third and the fourth image should be calculated to be not completely closed. You would have to zoom in to see the leak in the last image. There are two pixels inside which completely close the passage and thus form two separate holes but still there is a leak in the boundary.
I am hoping that there should be a simple way of solving this because it seems like its a common problem in image analysis.
0 Comments
Answers (1)
Image Analyst
on 6 Dec 2016
No, a "C" shaped blob is just as much a valid blob as a solid "O" disc-shaped blob. You could also say that the C or snake shaped blobs are closed since they enclose a region of a single pixel wide region. The best you can do it to try to join ends within a certain distance. So you can try edge-linking ( http://www.peterkovesi.com/matlabfns/#edgelink ), or morphological closing (imclose()) to try to close the gaps.
0 Comments
See Also
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!