i 'm dealing with a binary image that has a curved line and i want to find the tortuosity of the line, where tortuosity = (length of line) / (distance between the two endpoints). I'm calling regionprops-area to find the length and then i'm using the imdistline and getdistance commands in order to find the distance between the two endpoints (the coordinates of the endpoints are given). As a matter of fact the length is 113 pixels and the distance 121, but that makes no sense since the length of a curve between two points is always greater than the distance between them. Does anyone know what is wrong? i'm using the following code: F2=[111 301;222 349]; hline = imdistline(gca, F2(:,1), F2(:,2)); dist = getDistance(hline); stats=regionprops(F1, 'area'); length = [stats.Area] ; tortuosity= length / dist;
MATLAB: Trouble using regionprops and imdistline
areadistance between two pointsimage processingregioprops
Best Answer