how can I connect two or more connected components in binary image?
Show older comments
after I get connected components for binary image, I need to merge two or more connected components to be one CC
2 Comments
Matt J
on 19 Nov 2017
How do you get them? In what form do you have them now?
abdelrahim hashem
on 19 Nov 2017
Answers (1)
Image Analyst
on 19 Nov 2017
0 votes
Try imclose() to merge nearby regions into the same region.
2 Comments
abdelrahim hashem
on 20 Nov 2017
Image Analyst
on 20 Nov 2017
It basically dilates the binary blobs by one or more layers, making it "grow" and possibly connect to other blobs. This will also make the blob boundaries smoother. Then it erodes that by the same amount to get it back to the same size. The boundary will be smoother than the original and any connections made to adjacent blobs will still be there. So basically it will merge blobs and smooth the outlines.
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!