how to connect very disconnected pixels in an binary image ?

Hello ! I am trying to connect the edges of my 'im.png' (binary image) ..I have tried imfill,Edge Linking and Line Segment Fitting by Peter,bwconnect ,,but it is not helpful at all ... i want to have image like 'mJPCLN001.png'
If someone can help me by providing a code or give me some suggestion for how to link edges in my image,,ill be very obliged ..
Best regards

Answers (1)

Try activecontour. Demo is attached.

4 Comments

Thank you so much for quick and positive reply ...
I have tried this code but it only marked the boundaries of bw image ,,, but i want to connect the distinct pixel to form a connected smooth shape of Lung ... i have tried bwconnected pixel already ...
I hope you can help me ..
Let's see your code. activecontour() returns a binary image, not boundaries. What did you do with the bw variable that activecontour() gave you? That should be a smoother blobs image.
Dear ImageAnalyst
i got bw with another technique(Guassian gradient etc) ... i got the image names as ('im.png') .. but it gave me non linked edges of binary image ...
Thats why i asked for the help to connect distict edges ...
I'm not sure you saw my last message.

Sign in to comment.

Categories

Find more on Images in Help Center and File Exchange

Asked:

on 28 May 2016

Commented:

on 31 May 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!