- Threshold the image
- Use bwmorph(bw, 'skel', inf)
- Take the Euclidean distance transform of #1 with bwdist.
- Multiply those two together.
- Determine the radius of your lines.
- Threshold the image in step 4 at that radius.
Thinning the outline of an image
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi all,
I'm attempting to reduce the thickness of lines in an image systematically while keeping the skeleton of the figure the same. What this effectively comes down to is trimming the outer layer of pixels along the perimeter of the figure. Ultimately, I am trying to match the # of pixels between different images by thinning or thickening the lines that make up the figures while keeping the original size and shape of each figure the same.
I have played around with several functions such as bwboundaries, bwmorph ('skel', 'thin', 'remove', etc.) but I am pretty sure these functions are not the right ones to do the job that I want, or I am just using these functions the wrong way. I attached an example of what I am trying to accomplish featuring a BW image of the letter 'R' and one that I " thinned" crudely by hand. Thanks in advance!
0 commentaires
Réponses (1)
Image Analyst
le 7 Déc 2018
Try
3 commentaires
Image Analyst
le 10 Déc 2018
For 4
out = D .* bw;
For 5, finding out the radius, you can just take the mode of D, right?
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!