How to remove small spurs (branches) from a 'thinned' image?

I've binarized and thinned an image using
bwmorph(image, 'thin', Inf)
However, I'm left with a small spur at the end. The spur forms an intersection (of three branches) which has to be avoided in my case. How to remove it?
Below is the binarized image.
And this is the thinned image. The spur to be removed is mentioned with red mark.

Réponses (1)

Tarun Mudgal
Tarun Mudgal le 13 Mai 2017
Modifié(e) : Tarun Mudgal le 13 Mai 2017
I just added a condition that the distance of the endpoint with the branch should be less than (say) x pixels, then remove it.

Catégories

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by