资源简介
基于变分水平集的图像分割
MATLAB代码

代码片段和文件信息
% This Matlab file demomstrates a variational level set method that improves the original method in Li et al‘s paper
% “Level Set Evolution Without Re-initialization: A New Variational Formulation“
% in Proceedings of CVPR‘05 vol. 1 pp. 430-436.
% Author: Chunming Li all rights reserved.
% E-mail: li_chunming@hotmail.com
% URL: http://www.engr.uconn.edu/~cmli/
clear all;
close all;
Img = imread(‘Head.bmp‘); % The same cell image in the paper is used here
Img=double(Img(::1));
sigma=1.5; % scale parameter in Gaussian kernel for smoothing.
G=fspecial(‘gaussian‘15sigma);
Img_smooth=conv2(ImgG‘same‘); % smooth image by Gaussiin convolution
[IxIy]=gradient(Img_smooth);
f=Ix.^2+Iy.^2;
g=1./(1+f); % edge indicator function.
epsilon=1.5; % the papramater in the definition of smoothed Dirac function
timestep=5; % time step
mu=0.04; % coefficient of the internal (penalizing) energy term P(\phi)
% Note: The product timestep*mu must be less than 0.25 for stable evolution
lambda=5; % coefficient of the weighted length term Lg(\phi)
alf=1.5; % coefficient of the weighted area term Ag(\phi);
% Note: Choose a positive(negative) alf if the initial contour is outside(inside) the object.
% define initial level set function (LSF) as -c0 c0 at points outside and inside of a region R respectively.
[nrow ncol]=size(Img);
c0=2; % The constant value used to define binary level set function as initial LSF;
% Using larger value of c0 usually slow down the evolution.
initialLSF=c0*ones(nrowncol);
w=8;
initialLSF(w+1:end-w w+1:end-w)=-c0;
u=initialLSF;
figure;imagesc(Img [0 255]);colormap(gray);hold on;
[ch] = contour(u[0 0]‘r‘);
title(‘Initial contour‘);
% start level set evolution
for n=1:1000
u=EVOLUTION_LSD(u g lambda mu alf epsilon timestep 1);
if mod(n20)==0
pause(0.001);
imagesc(Img [0 255]);colormap(gray);hold on;
[ch] = contour(u[0 0]‘r‘);
iterNum=[num2str(n) ‘ iterations‘];
title(iterNum);
hold off;
end
end
imagesc(Img [0 255]);colormap(gray);hold on;
[ch] = contour(u[0 0]‘r‘);
totalIterNum=[num2str(n) ‘ iterations‘];
title([‘Final contour ‘ totalIterNum]);
figure;
mesh(u);
title(‘Final level set function‘);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-12-29 20:12 Variational_LevelSet\
目录 0 2013-12-29 16:03 Variational_LevelSet\_LevelSet\
文件 64193 2013-12-28 10:55 Variational_LevelSet\_LevelSet\Added_Circut1.bmp
文件 68613 2013-12-28 10:56 Variational_LevelSet\_LevelSet\Added_Circut2.bmp
文件 83018 2013-12-28 10:55 Variational_LevelSet\_LevelSet\Added_Circut3.bmp
文件 86161 2013-12-28 10:55 Variational_LevelSet\_LevelSet\Added_Circut4.bmp
文件 83586 2013-12-28 10:54 Variational_LevelSet\_LevelSet\Added_Circut5.bmp
文件 38029 2013-12-28 10:55 Variational_LevelSet\_LevelSet\Added_Circut6.bmp
文件 2407 2013-12-28 11:54 Variational_LevelSet\_LevelSet\Demo1.m
文件 2638 2013-12-28 11:56 Variational_LevelSet\_LevelSet\Demo1_ManualBinaryInitial.m
文件 2380 2013-12-28 11:55 Variational_LevelSet\_LevelSet\Demo2.m
文件 2608 2007-03-20 14:33 Variational_LevelSet\_LevelSet\Demo2_ManualBinaryInitial.m
文件 3425 2013-12-28 11:58 Variational_LevelSet\_LevelSet\Demo3_initialFromThresh.m
文件 1125 2007-01-17 22:51 Variational_LevelSet\_LevelSet\EVOLUTION_LSD.m
文件 65818 2013-12-28 10:48 Variational_LevelSet\_LevelSet\Head.bmp
文件 801246 2006-02-03 16:17 Variational_LevelSet\_LevelSet\levelset_CVPR05.pdf
文件 24576 2007-01-31 22:49 Variational_LevelSet\_LevelSet\LSD.dll
文件 10078 2007-02-01 01:41 Variational_LevelSet\_LevelSet\noisyStar_SNR_20_to_10.bmp
文件 16434 2004-07-23 19:36 Variational_LevelSet\_LevelSet\twocells.bmp
文件 8134 2004-07-05 18:59 Variational_LevelSet\_LevelSet\twoObj.bmp
相关资源
- 读取txt文件内容matlab代码实现
- 细胞图像分割matlab代码
- 基于MP的时频分析MATLAB代码
- WCDMA matlab代码
- 图像降噪Matlab代码
- 圣诞树(matlab代码)
- 心音信号处理分析(附matlab代码)
- Pattern Recognition and Machine Learning(高清
- 均值滤波和FFT频谱分析Matlab代码
- 欧拉放大论文及matlab代码
- GPS信号的码捕获matlab代码.7z
- matlab读取SP3文件
- 图像的饱和度,亮度,色调的matlab代
- 肤色检测matlab代码
- sutton强化学习随书MATLAB代码
- 压缩鬼成像matlab代码
- 压缩感知(Compressed Sensing CS)matlab代
- 基于OFDMA系统的多用户资源分配算法,
- Allan方差分析MATLAB代码,含MPU6050八小
- 均匀球体剖面重力异常正演模拟Matl
- 印章识别matlab代码
- 连续潮流matlab代码
- 线性拟合仿真-最小二乘法、正交回归
- 矩阵填充MATLAB代码
- 大型飞机航拍图处理matlab代码
- LMS语音信号去噪matlab代码
- 卡尔曼滤波MATLAB代码
- Matlab代码编写的semi-supervised CCA 程序
- EOF分析matlab代码
- 尾灯识别matlab代码
评论
共有 条评论