資源簡介
張的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模型水平集
- 下一篇:動態差分進化算法訓練神經網絡逼近函數
評論
共有 條評論