资源简介
水平集图像分割的Matlab程序代码,搞图像的人必不可少的利器啊
经典的算法

代码片段和文件信息
% This Matlab program demomstrates the level set algorithm in paper:
% “Active contours with selective local or global segmentation: a new variational approach and level set method“
% to appear in Image and Vision Computing 2010.
% Authors: Kaihua Zhang Lei Zhang Huihui Song and Wengang Zhou
% E-mail: zhkhua@mail.ustc.edu.cn cslzhang@comp.polyu.edu.hk
% URL: http://www4.comp.polyu.edu.hk/~cslzhang/
% Notes:Some parameters may need to be modified for different types of images.
% Please contact the authors if any problem regarding the choice of parameters.
% Date: 5/11/2009
clc;clear all;close all;
Img = imread(‘twocells.bmp‘);
Img = Img(::1);
Img = double(Img);
% Img = 200*ones(100);
% Img(20:8010:30)= 140;
% Img(20:8040:70)= 180;
% Img(20:8080:90)=50;
[rowcol] = size(Img);
phi = ones(rowcol);
phi(10:row-1010:col-10) = -1;
u = - phi;
[c h] = contour(u [0 0] ‘r‘);
title(‘Initial contour‘);
% hold off;
sigma = 1;
G = fspecial(‘gaussian‘ 5 sigma);
delt = 1;
Iter = 80;
mu = 25;%this parameter needs to be tuned according to the images
for n = 1:Iter
[ux uy] = gradient(u);
c1 = sum(sum(Img.*(u<0)))/(sum(sum(u<0)));% we use the standard Heaviside function which yields similar results to regularized one.
c2 = sum(sum(Img.*(u>=0)))/(sum(sum(u>=0)));
spf = Img - (c1 + c2)/2;
spf = spf/(max(abs(spf(:))));
u = u + delt*(mu*spf.*sqrt(ux.^2 + uy.^2));
if mod(n10)==0
imagesc(Img[0 255]); colormap(gray);hold on;
[c h] = contour(u [0 0] ‘r‘);
iterNum = [num2str(n) ‘iterations‘];
title(iterNum);
pause(0.02);
end
u = (u >= 0) - ( u< 0);% the selective step.
u = conv2(u G ‘same‘);
end
imagesc(Img[0 255]);colormap(gray);hold on;
[c h] = contour(u [0 0] ‘b‘);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 27512 2009-09-07 17:15 brain1.bmp
文件 53910 2008-03-07 16:42 d.bmp
文件 1862 2009-11-05 13:59 Demo.m
文件 59014 2008-03-07 16:44 e.bmp
文件 15120 2008-06-21 16:16 fin1.bmp
文件 49186 2009-08-06 21:44 galaxy.jpg
文件 26840 2008-03-26 18:54 h.bmp
文件 47001 2009-08-06 20:23 lv1.JPG
文件 68166 2009-08-06 21:17 lvmr1.bmp
文件 34798 2009-08-06 19:11 narrow.bmp
文件 34798 2009-08-09 10:12 nn.bmp
文件 121976 2009-08-08 10:43 plane2.bmp
文件 28173 2007-10-31 15:54 plane4.jpg
文件 16434 2004-07-23 19:36 twocells.bmp
- 上一篇:STOI 短时客观可懂度MATLAB代码
- 下一篇:FFT的图像配准
相关资源
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
- k近邻算法matlab实现
- matlab识别系统
- 神经网络分类matlab程序
评论
共有 条评论