evolution_cv.m

来自「水平集分割算法的C-V模型」· M 代码 · 共 22 行

M
22
字号
function phi =evolution_cv(I, phi0, mu, nu, lambda_1, lambda_2, delta_t, epsilon, numter);
%   input: 
%       I: input image
%       phi0: level set function to be updated
%       mu: weight for length term
%       nu: weight for area term, default value 0
%       lambda_1:  weight for c1 fitting term
%       lambda_2:  weight for c2 fitting term
%       delta_t: time step
%       epsilon: parameter for computing smooth Heaviside and dirac function
%       numIter: number of iterations
%   output: 
%       phi: updated level set function
phi=phi0;
for k=1:numter
    phi=NeumannBoundCond(phi);
    delta_h=Delta(phi,epsilon);
    Curv = curvature(phi);
    [C1,C2]=binaryfit(phi,I,epsilon);
    % updating the phi function
    phi=phi+delta_t*delta_h.*(mu*Curv-nu-lambda_1*(I-C1).^2+lambda_2*(I-C2).^2);    
end  

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?