How to make traversal in an image and change color of the specified pixels along the path by some criteria, for example in my image i shown as under, I want to place after each five pixels a white pixel in an image.?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Réponse acceptée
Image Analyst
le 19 Nov 2017
I think you want bwmorph() with the 'endpoints' and 'branchpoints' options.
3 commentaires
Image Analyst
le 19 Nov 2017
Why? You can subtract branchpoints from the original image to break it apart into segments. Then you'd have to write some custom code to "traverse" each segment but I see no reason to do this. Good luck on writing that code though.
Plus de réponses (2)
Walter Roberson
le 18 Nov 2017
12 commentaires
Image Analyst
le 19 Nov 2017
You can remove the branchpoints to break apart the blobs. Then use regionprops() and ask for PixelIdxList to get the linear indexes or PixelList to get a list of (x,y) coordinates of pixels in the blob. This may not give pixels in the exact order - it probably does for linear shapes but you'd have to check for blobs that loop back, like a C shape.
Voir également
Catégories
En savoir plus sur Graph and Network Algorithms dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
