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
Afficher commentaires plus anciens
I have holes in my outline. How to fill holes because i like to apply a poly2mask to closed outline
4 commentaires
Walter Roberson
le 19 Juin 2012
http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers
Mohamed Amine
le 19 Juin 2012
Image Analyst
le 19 Juin 2012
That link doesn't work.
Walter Roberson
le 19 Juin 2012
It had an extra colon at the beginning
https://www.dropbox.com/sh/gb02kopgo0ukmx2/WesN7ZS7C1
Réponses (1)
Image Analyst
le 20 Juin 2012
0 votes
Try edge linking. Here's one professor's implementation: http://www.csse.uwa.edu.au/~pk/Research/MatlabFns/#edgelink
13 commentaires
Mohamed Amine
le 20 Juin 2012
Walter Roberson
le 20 Juin 2012
Example of using the method is at http://www.csse.uwa.edu.au/~pk/Research/MatlabFns/LineSegments/example/index.html
Mohamed Amine
le 20 Juin 2012
Mohamed Amine
le 20 Juin 2012
Walter Roberson
le 20 Juin 2012
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?
Image Analyst
le 20 Juin 2012
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...
Mohamed Amine
le 20 Juin 2012
Walter Roberson
le 20 Juin 2012
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
Image Analyst
le 20 Juin 2012
By the way, I can't use dropbox - my company blocks that one for some reason. Try tinypic.com.
Mohamed Amine
le 20 Juin 2012
Walter Roberson
le 20 Juin 2012
We're going to need the image back.
Image Analyst
le 20 Juin 2012
Also tell us the big picture. Forget about the outline for the moment. What do you really want to measure in the image?
Ryan
le 20 Juin 2012
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.
Catégories
En savoir plus sur Conversion Between Symbolic and Numeric dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!