【图像分割】基于水平集图像分割LGIF模型实现医学图像分割附matlab代码

 1 简介

基于全局和局部图像信息的水平集模型(LGIF模型),其基本思想是:在演化过程中,既利用图像的全局信息,也利用图像的局部信息来驱动曲线的演化,LGIF模型其实就是将LIF模型和GIF模型(ACM with Global Image Fitting model)两者的优点结合而形成的新模型,其中LIF模型表示图像的局部信息项,GIF模型表示图像的全局信息项。因而,LGIF模型既具有LIF模型的优点,利用图像的局部领域信息,可以在一定程度上处理灰度不均匀的图像;也具有GIF模型的优点,运用图像的全局信息,使得LGIF模型对初始轮廓的位置不敏感。其中,LIF模型的能量泛函定义如下:

2 部分代码

%   Matlab code implementing Chan-Vese model in the paper 'Active Contours Without Edges'%   This method works well for bimodal images, for example the image 'three.bmp'clcclear allclose allc0 =2;imgID=2;Img=imread('cq391.jpg');    U=Img(:,:,1);% the initial level setswitch imgID     case 1       phi= ones(size(Img(:,:,1))).*c0;              a=43;b=51;c=20;d=28;       phi(a:b,c:d) = -c0;       figure;       imshow(Img);colormap;       hold on;       plotLevelSet(phi, 0, 'g');       hold off;    case 2       [m,n]=size(Img(:,:,1));       a=m/2; b=n/2;r=5;       phi= ones(m,n).*c0;       phi(a-r:a+r,b-r:b+r) = -c0;       imshow(Img);colormap;       hold on;       plotLevelSet(phi, 0, 'r');       hold off;    case 3       figure;imagesc(Img, [0, 255]);colormap(gray);hold on; axis off;axis equal;       text(6,6,'Left click to get points, right click to get end point','FontSize',[12],'Color', 'g');       BW=roipoly;       phi=c0*2*(0.5-BW);       hold on;       [c,h] = contour(phi,[0 0],'r');       hold off;endpause(1);%参数选择pause(0.1);lambda=0.001*255*255; lambda1=1.0;lambda2=1.0;delta_t =0.1;epsilon=1;mu =1;numIter = 1;% CV和LBF的权重Img=double(U);M=0.05; % scale parameter in Gaussian kernelsigma=3.0;   K=fspecial('gaussian',round(2*sigma)*2+1,sigma); % Gaussian kernelKI=conv2(Img,K,'same');  KONE=conv2(ones(size(Img)),K,'same');% start level set evolutiontime = cputime;for k=1:1000   phi = evolution_LGIF(Img,K,KI,KONE,phi,M,lambda1,lambda2,mu,lambda,delta_t,epsilon,numIter);  % update level set function    if mod(k,5)==0        pause(0.01);        imagesc(Img, [0, 255]);colormap(gray);hold on; axis off;        contour(phi,[0 0],'r');        iterNum=[num2str(k), ' iterations'];        title(iterNum);        hold off;    end    endtotaltime = cputime - time;imagesc(Img, [0, 255]);colormap(gray);hold on; axis off;contour(phi,[0 0],'r');iterNum=[num2str(k), ' iterations'];title(iterNum);

3 仿真结果

4 参考文献

[1]管观华. 基于水平集方法的胰腺图像分割研究. 

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。

  • 0
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

matlab科研助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值