Sign up ×
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It's 100% free, no registration required.

I have a skeleton image. I am able to detect branchpoints, endpoints and able to label image using BWMorph, BWLabel. Now I want to differntiate between skeleton center line and branches. In short I want to detect branches in skeleton. I want to perform operations on skeleton branches and I do not want to consider center line in these operations. Can someone help? Following is skeleton image. Arrows in following image show center line of skeleton.

Following is code I have used.

[row column] = find(mn);
branchPts    = [row column];
endImg    = bwmorph(y, 'endpoints');
[row column] = find(endImg);
endPts       = [row column];
hold on ; 
hold on; plot(endPts(:,2),endPts(:,1),'*');
% Labeling the Branches
branches = imsubtract(y,mn); % set branch points to zero
figure; imshow(branches);title('no bp')
branchesLabeled = bwlabel( branches); % label connected components
% Calculation of Length of Branches and Circular Neighbourhood Method for
% for detection of normal and abnormal branches.
sts = regionprops( branchesLabeled,'Area', 'Perimeter','MajorAxisLength','Centroid' );
hold on
% Loop for circles
for i=1:size(sts)
r= sts(i).MajorAxisLength/2 ; %desired radius
centerx = sts(i).Centroid(1);  
centery = sts(i).Centroid(2);
th = 0:pi/50:2*pi;
xunit = r * cos(th) + centerx;
yunit = r * sin(th) + centery;
plot(xunit, yunit);
share|improve this question

migrated from Jan 24 '13 at 15:04

This question came from our site for professional and enthusiast programmers.

What are these operations on the skeleton that you want to perform ? It might be possible to recover the main branches in its entirety after you perform these operations. – mmgp Jan 24 '13 at 15:18
Thank you for your reply. I want to draw circle on each branch with branch lengh/2 as a redius. And I do not want circle on the center line of skeleton. – user1984451 Jan 24 '13 at 17:07
may i take your code to detect branchpoints, endpoints and label image using BWMorph, BWLabel? thanks for ur respon :) – user9045 May 28 '14 at 2:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.