I want to select the morphological branch points of a thinned image to create a MorphologicalGraph like the one obtained by Pruning.

enter image description here enter image description here

I want to avoid the pruning step. How can I delete from the MorphologicalGraph of the first image all points that are not morphological branch points?


1 Answer 1

img = Import["https://i.stack.imgur.com/uBeKs.png"]

Mathematica graphics

mg = MorphologicalGraph[img, ImageSize -> 200]

Mathematica graphics

vdF = With[{gr = #}, VertexDelete[gr, _?(VertexDegree[gr, #] <= 1 &)]] &;

Row[NestList[vdF, mg, 4]]

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.