资源简介
基于变分水平集的图像分割
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
相关资源
- Mie matlab
- DRLSE距离正则化水平集演化算法的MA
- The Finite Element Method for Thermal and Stre
- 图像中红色标记去除Matlab代码实现
- 语音处理,改变声调、语速等,matl
- 传感器网络节点定位算法matlab代码.
- Canny边缘检测Matlab代码
- 基于adaboost算法的目标检测MATLAB代码
- Gabor滤波后的GIST特征提取matlab代码
- gbvs算法的matlab代码
- sift matlab代码
- 一个通信抗干扰仿真MATLAB代码
- 小波变换法图像融合MATLAB代码
- 基于相位谱视觉注意机制matlab代码
- 车牌识别_matlab_模式识别(MATLAB代码,
- 基于颜色的图像分割算法MATLAB代码
- 基于信息熵的约简MATLAB代码
- 1维的简单LDA和2维LDA人脸识别的matla
- 基于哈希的图像检索LSH,ITQmatlab代码
- 结构光超分辨MATLAB代码,测试图像,
- 交替方向乘子法ADMM算法的matlab代码
- 图像插值方法3种方法,MATLAB代码
- 端元提取——顶点成分分析VCA的MATL
- LSB信息隐藏实验 matlab代码及实验报告
- 7个经典传感器网络WSN节点定位算法的
- 图像处理的常见滤波方法,matlab代码
- surf的matlab代码
- 多层ELM进行MNIST手写字符分类MATLAB代码
- 粒子滤波完整仿真matlab代码
- 数学建模 30种算法MATLAB代码
评论
共有 条评论