7
$\begingroup$

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?

$\endgroup$
9
$\begingroup$
img = Import["http://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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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