Number of branches per branch point

10 visualizaciones (últimos 30 días)
Daniele Cossellu
Daniele Cossellu el 21 de Jul. de 2021
Comentada: Daniele Cossellu el 22 de Jul. de 2021
Hi! I have a skeleton image (the attached one) and i want to compute how many branches there are for each branch point. Eg: there are two branchpoints with four branches, three branchpoints with three branches, etc. Anyone knows how to do this?

Respuesta aceptada

Matt J
Matt J el 21 de Jul. de 2021
Editada: Matt J el 21 de Jul. de 2021
Perhaps as follows:
k=ones(3); k(5)=0;
neighborCount=conv2(double(BW),k,'same');
neighborCount=neighborCount.*(neighborCount>2);
[row, col, numBranches]=find(neighborCount); %branch point (row,col) coordinates and number of branches.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by