miniprojet/learning/code/max_contour.m

18 lines
No EOL
341 B
Matlab

function [cont]=max_contour(contours)
i=1;
id=1;
max = 0;
while i+contours(2, id) < size(contours, 2)
contours(2,i);
if contours(2,i) > max
max = contours(2,i);
id = i;
end
i=i+1+contours(2,i);
end
cont = zeros(max, 2);
cont(1:end,1) = contours(1, id+1:id+max);
cont(1:end,2) = contours(2, id+1:id+max);
end