Number of branches per branch point

조회 수: 8 (최근 30일)
Daniele Cossellu
Daniele Cossellu 2021년 7월 21일
댓글: Daniele Cossellu 2021년 7월 22일
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?

채택된 답변

Matt J
Matt J 2021년 7월 21일
편집: Matt J 2021년 7월 21일
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.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by