sir,what can i do for remove the small branches from the following image and display number of branch point after removing the small branches?
2 次查看(过去 30 天)
显示 更早的评论
</matlabcentral/answers/uploaded_files/10209/skel.jpg> this is my code to plot the branch points :
%W2=is skeleton image using bwmorph
L = bwmorph(W2,'branchpoints'); [row column] = find(L); branchPts = [row column]; endImg=bwmorph(W2,'endpoints'); [row column]=find(endImg); endPts = [row column]; figure, imshow(W2); title('branching points'); hold on; plot(branchPts(:,2),branchPts(:,1),'r.'); %plot(endPts(:,2),endPts(:,1),'go');
se=strel('disk',5,8); dl=imdilate(L,se); %figure; %imshow(dl); %dilation of branches ccbranches=bwconncomp(L,8); nob=ccbranches.NumObjects; vwb=f1; %vessel without branch points vwb(dl)=0; cc=bwconncomp(vwb); Noriginal=ccbranches.NumObjects; disp('Number of branch points:'); disp(Noriginal);
this is the output of above code
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/159196/image.jpeg)
I want to remove the smaller branches from this image and branchpoints only diplayed for larger vessel(branch)
I have to use the spur operation in bwmorph.this is not worked.
0 个评论
回答(1 个)
zoey yang
2019-4-22
Actually, you can scan your points in your image by looking at their neighbors. If a point has three neighbors that equal to one, this point is the one that you are looking for. Start from this point, find its branches. Let set the threshold as, like 10. That means if the branch length is shorter than 10 nodes, we will remove it.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 3-D Volumetric Image Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!