Jonathan
Jonathan

Reputation: 1936

Segmenting individual blobs connected by boundaries

Let's say I have the following image. enter image description here

I want to consider these two blobs as two separate blobs; however, finding connected components labels them as a single component because they are touching.

I tried img = bwmorph(img, 'branchpoints'); and that does segment and erode these two blobs but that also erases blobs other blobs. For instance, in the following image, the upper left structure has been erased, but that structure should not be erased and moreover, I would like to segment that structure as two blobs that can be evidently seen.

enter image description here enter image description here

The unfilled blob on the left has disappeared. How to get around this problem?

Upvotes: 0

Views: 76

Answers (1)

bla
bla

Reputation: 26069

here's an idea, use imfill to fill holes in your blobs:

bw=imfill(im,'holes');

then do bw-im and get this:

enter image description here

you can take it from there...

Upvotes: 2

Related Questions