How to remove boundary discontinuity in image?

6 views (last 30 days)
I have a big dataset of images which I tried different kinds of edge detection algorithms to extract object's boundary. But in all methods, there are always some images with discontinuities in object's boundary. I also used morphological "shrink" operation. But the problem is that for shrink, I must set image border to white pixels which in some images does not help extracting the edge because still pixels around image border are not connected. So shrink does not work and I just get an image which is mostly black.
What should I do? I tried dilation and erosion to connect pixels but it didn't work properly in some pixels and made extra problems. I used different kinds of structuring element (disk, diamond, line, ...). Problem is usually in between fingers. This is one of my images. You can see that setting image borders to "1" does not solve anything.

Answers (1)

Image Analyst
Image Analyst on 2 May 2015
Why don't you label the image with bwlabel, then get the coordinates with regionprops(binaryImage, 'PixelList'). Then get endpoints with bwmorph. Then use those two pieces of information to draw a line, with imline(), from an endpoint of one blob to the closest endpoint of the other blob? Conceptually it makes sense, right? You're just drawing a line from one curve endpoint to the closest other curve endpoint. It's not hard, so at least give it a try with the functions I told you to use, and show me your code after you say "I'm stuck".

Categories

Find more on Images in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!