I have holes in my outline. How to fill holes because i like to apply a poly2mask to closed outline.Please I need your help

I have holes in my outline. How to fill holes because i like to apply a poly2mask to closed outline

4 commentaires

http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers
my images url :https://www.dropbox.com/sh/gb02kopgo0ukmx2/WesN7ZS7C1
how t fill holes in outline and how to detect pixels inside outline that he will be closed
It had an extra colon at the beginning
https://www.dropbox.com/sh/gb02kopgo0ukmx2/WesN7ZS7C1

Connectez-vous pour commenter.

Réponses (1)

Try edge linking. Here's one professor's implementation: http://www.csse.uwa.edu.au/~pk/Research/MatlabFns/#edgelink

13 commentaires

PLease give me exemple with this method, i have this file that represent my image : https://www.dropbox.com/sh/gb02kopgo0ukmx2/WesN7ZS7C1
it is a matrix that represent my image i have se this implimentation but i have not idea how to use this methode to link my outline, please help me.
Example of using the method is at http://www.csse.uwa.edu.au/~pk/Research/MatlabFns/LineSegments/example/index.html
I see this exemple but when i test it my outline is not linked. So my question is how to linked outline because i have holes in my outline.
if you see the spoon in exemple is not closed.
Threshold and convert to BW before doing the Canny ?
The image link you gave above no longer has an image, and now has only a .mat file.
My memory of your image is that you had a fairly large gap, possibly larger than was suitable for this technique.
Have you tried using a convex hull and finding the "inside" edge of that?
You may have to adjust some parameters to get it to link larger gaps. Or look for different edge linking routines or write your own. Or else just process your image in a different way so that you don't get gaps in the first place. Maybe use contour() or something...
I don't do the canny because my outline is SLD.mat and when i do im2bw(SLD), it is the same, my problem is to linked my outline and to find pixels inside outline using poly2mask
Threshold and convert to BW is a suggestion on how to deal with the differing reflectivity levels in the spoon. You asked for an example, right, not us to do your work for you, right?
Have you tried using a convex hull and finding the "inside" edge of that?
Please post your image up again; I seldom bother to download .mat files
By the way, I can't use dropbox - my company blocks that one for some reason. Try tinypic.com.
I test convex hull but there are many pixels that outsside outline so it is not a good method.I need your advice and not to do my work
We're going to need the image back.
Also tell us the big picture. Forget about the outline for the moment. What do you really want to measure in the image?
The small holes could be closed with a dilation and re-thinning, iirc. Then find the end points (which would be the top gap) and connect them with a line.

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by