资源简介
张的LIF模型,李春明模型的改进,很流行
代码片段和文件信息
% This Matlab program demomstrates the level set algorithm in paper:
% “Active contours driven by local image fitting energy“
% to appear in Pattern Recognition 2010
% Author: Kaihua Zhang Huihui Song and Lei Zhang
% E-mail: zhkhua@mail.ustc.edu.cn cslzhang@comp.polyu.edu.hk
% http://www4.comp.polyu.edu.hk/~cslzhang/
% Notes:
% 1. Some parameters may need to be modified for different types of images. Please contact the author if any problem regarding the choice of parameters.
% 2. Intial contour should be set properly.
% Date: 5/11/2009
clear all;close all;clc;
Img = imread(‘3c.bmp‘);
Img = double(Img(::1));
sigma =3;% the key parameter which needs to be tuned properly.
sigma_phi = 0.5;% the variance of regularized Gaussian kernel
K = fspecial(‘gaussian‘2*round(2*sigma)+1sigma);
K_phi = fspecial(‘gaussian‘5sigma_phi);
[nrowncol] = size(Img);
phi = ones(nrowncol);
phi(15:nrow-1515:ncol-15) = -1;
figure; imagesc(Img[0 255]);colormap(gray);hold on;
contour(phi[0 0]‘b‘);
timestep = 1;
epsilon = 1.5;
for n = 1:600
[phif1f2Hphi]= LIF_2D(ImgphitimestepepsilonK);
phi = conv2(phiK_phi‘same‘);
if mod(n40)==0
pause(0.0001);
imagesc(Img[0 255]);colormap(gray)
hold on;contour(phi[0 0]‘b‘);
iterNum=[num2str(n) ‘ iterations‘];
title(iterNum);
hold off;
end
end
figure;
mesh(phi);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 17160 2007-10-07 22:31 3c.bmp
文件 1460 2009-11-05 14:00 Demo.m
文件 894 2009-11-03 09:14 LIF_2D.m
- 上一篇:经典CV模型水平集
- 下一篇:动态差分进化算法训练神经网络逼近函数
评论
共有 条评论