skltn = bwmorph(binaryImage, 'skel', Inf); %getting skeleton of binary image
endpts = bwmorph(skltn, 'endpoints'); %getting enpoints of 'skltn'
[node_x, node_y] = find(endpoints==1); %getting the x and y coordinates of the endpoints in
%node_x and node_y respectively
%Now, how do I find the topmost, bottomost, leftmost and rightmost endpoints? Please help.
MATLAB: How to find the topmost, bottomost, leftmost and rightmost endpoints of a skeleton of a binary image? Please help.
bwmorphendpointsImage Processing Toolboxskelskeletonskeletonization
Best Answer