PDA

View Full Version : Find the maximum and minimum dimension of a closed loop


elgen
Aug4-10, 03:01 PM
Dear all,

Is there a method to find the maximum and minimum dimension of an irregular closed loop? This is a problem when we want to define the full-width - half maximum of a image. The level contour of this image at its half maximum can be an irregular closed loop.

Any reference or comment is welcome. Thank you.

elgen

elgen
Aug4-10, 03:37 PM
Ah ... the maximum dimension is needed. Need to calculate the distance between every two points on the contour and the largest distance is the maximum dimension.
Here is the pseudo code, which x is Nx2 vector


for i=1:nPoints
for j=i+1:nPoints
temp = norm(x(i,:)-x(j,:));
if (temp > distance)
distance = temp;
idx = [i j];
end
end
end


Result of some quick thinking. Perhaps there is a better way.

elgen