ac_length.m
来自「active contours in matlab」· M 代码 · 共 24 行
M
24 行
function aclength = ac_length(acontour)
%ac_length: length of an active contour
% l = ac_length(a) computes the length, l, of an active contour, a.
%
%See also acontour.
%
%Active Contour Toolbox by Eric Debreuve
%Last update: June 15, 2006
aclength = 0;
for subac_idx = 1:length(acontour)
interval = ppbrk(acontour(subac_idx), 'interval');
tangent = fnder(acontour(subac_idx));
aclength = aclength + quad(@n_velocity, 0, interval(2));
end
function velocity = n_velocity(t)
velocity = sqrt(sum(ppval(tangent, t).^2));
end
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?