Image processing for determining endpoints on a line
이전 댓글 표시
Hello,
I am looking to calculate the distance between endpoints of several skeletonized images. However, at the moment, the bwmorph function identifies endpoints in the skeletonized image that I am not interested in. My code for identifying the endpoints is below, and three examples of BW files are attached in .mat format.
imshow(BW)
BW2 = bwpropfilt(BW, 'perimeter', 1);
skel = bwskel(BW2);
imshow(skel)
[I,J]=find(bwmorph(skel,'endpoints'));
hold on
scatter(J, I)
I want to refine this code so that only the endpoints that I am interested in are identified. The endpoints that I am interested in are the ones at the true ends of the line. An image of the endpoints that are identified for BW_3 with my current code is shown below. As can be seen, far too many endpoints are found.

I have attempted to pass a minimum branch length into the bwskel function but this does not work for all of my images.
Any help with this would be appreciated.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Morphological Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
