资源简介
利用GVFSnake算法实现灰度图像的边缘检测和图像分割

代码片段和文件信息
% EXAMPLE GVF snake examples on two simulated object boundaries.
%
% NOTE:
%
% traditional snake and distance snake differed from GVF snake only
% by using different external force field. In order to produce the
% corresponding external force field use the following (all
% assuming edge map f is in memory).
%
% traditional snake:
% f0 = gaussianBlur(f1);
% [pxpy] = gradient(f0);
%
% distance snake:
% D = dt(f>0.5); % distance transform (dt) require binary edge map
% [pxpy] = gradient(-D);
%
% [pxpy] is the external force field in both cases
%
% balloon model using a different matlab function “snakedeform2“
% instead of “snakedeform“. The external force could be any force
% field generated above.
%
% an example of using it is as follows
% [xy] = snakedeform2(xy alpha beta gamma kappa kappap pxpy2);
% do a “help snakedeform2“ for more details
% Chenyang Xu and Jerry Prince 6/17/97
% Copyright (c) 1996-97 by Chenyang Xu and Jerry Prince
cd ..; s = cd; s = [s ‘/snake‘]; path(s path); cd examples;
help gvf_ex;
% ==== Example 1: U-shape object ====
% Read in the 64x64 U-shape image
[Imap] = rawread(‘../images/U64.pgm‘);
% Compute its edge map
disp(‘ Compute edge map ...‘);
f = 1 - I/255;
% Compute the GVF of the edge map f
disp(‘ Compute GVF ...‘);
[uv] = GVF(f 0.2 80);
disp(‘ Nomalizing the GVF external force ...‘);
mag = sqrt(u.*u+v.*v);
px = u./(mag+1e-10); py = v./(mag+1e-10);
% display the results
figure(1);
subplot(221); imdisp(I); title(‘test image‘);
subplot(222); imdisp(f); title(‘edge map‘);
% display the gradient of the edge map
[fxfy] = gradient(f);
subplot(223); quiver(fxfy);
axis off; axis equal; axis ‘ij‘; % fix the axis
title(‘edge map gradient‘);
% display the GVF
subplot(224); quiver(pxpy);
axis off; axis equal; axis ‘ij‘; % fix the axis
title(‘normalized GVF field‘);
% snake deformation
disp(‘ Press any key to start GVF snake deformation‘);
pause;
subplot(221);
image(((1-f)+1)*40);
axis(‘square‘ ‘off‘);
colormap(gray(64));
t = 0:0.05:6.28;
x = 32 + 30*cos(t);
y = 32 + 30*sin(t);
[xy] = snakeinterp(xy31); % this is for student version
% for professional version use
% [xy] = snakeinterp(xy20.5);
snakedisp(xy‘r‘)
pause(1);
for i=1:25
[xy] = snakedeform(xy0.05010.6pxpy5);
[xy] = snakeinterp(xy31); % this is for student version
% for professional version use
% [xy] = snakeinterp(xy20.5);
snakedisp(xy‘r‘)
title([‘Deformation in progress iter = ‘ num2str(i*5)])
pause(0.5);
end
disp(‘ Press any key to display the final result‘);
pause;
cla;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4963 1999-09-28 08:58 gvf_ex.m
..AD... 0 2008-01-27 20:42 images
文件 4109 1999-09-28 08:58 images\room.pgm
文件 4109 1999-09-28 08:58 images\U64.pgm
文件 298 1999-09-28 08:58 images\WS_FTP.LOG
..AD... 0 2008-01-27 20:42 papers
文件 2073541 1999-09-28 08:58 papers\cvpr97.ps
文件 4148055 1999-09-28 08:58 papers\tip.ps
文件 298 1999-09-28 08:58 papers\WS_FTP.LOG
..AD... 0 2008-01-27 20:41 snake
文件 916 1999-12-13 13:41 snake\BoundMirrorEnsure.m
文件 699 1999-09-28 08:58 snake\BoundMirrorExpand.m
文件 488 1999-09-28 08:58 snake\BoundMirrorShrink.m
文件 1096 1999-09-28 08:58 snake\Contents.m
文件 608 1999-09-28 08:58 snake\dt.m
文件 500 1999-09-28 08:58 snake\gaussianBlur.m
文件 255 1999-09-28 08:58 snake\gaussianMask.m
文件 1637 1999-09-28 08:58 snake\GVF.m
文件 252 1999-09-28 08:58 snake\imdisp.m
文件 3256 1999-09-28 08:58 snake\rawread.m
文件 1526 1999-09-28 08:58 snake\rawwrite.m
文件 1501 1999-09-28 08:58 snake\snakedeform.m
文件 1856 1999-09-28 08:58 snake\snakedeform2.m
文件 551 1999-09-28 08:58 snake\snakedisp.m
文件 190 1999-09-28 08:58 snake\snakeindex.m
文件 894 1999-09-28 08:58 snake\snakeinit.m
文件 1593 1999-09-28 08:58 snake\snakeinterp.m
文件 1310 1999-09-28 08:58 snake\snakeinterp1.m
文件 913 1999-09-28 08:58 snake\xconv2.m
目录 0 2008-01-31 21:25 GVFSnake(matlab)
............此处省略34个文件信息
- 上一篇:波束形成Matlab程序218509
- 下一篇:map match matlab
相关资源
- 基于matlab的图像处理源程序
- 引导图像滤波器 Matlab实现
- 图像小波变换MatLab源代码
- 冈萨雷斯数字图像处理matlab版(第三
- 基于区域生长的图像分割MATLAB
- 基于matlab 的图像处理100实例
- 8领域边界跟踪 图像处理 matlab
- 细胞图像分割matlab代码
- 图像的二进小波分解matlab源码(保证
- Matlab图像二值化和逆向二值化
- matlab-图像处理算法
- p文件,MATLAB的
- matlab 数字图像对比度拉伸算法
- MATLAB实现混沌图像加密仿真程序
- 数字图像处理radon matlab变换算法代码
- 图像匹配matlab源程序sift算法
- 图像降噪Matlab代码
- Matlab图像分割边缘提取算法
- 基于MATLAB的图像特征点匹配和筛选
- 传统关联成像、计算鬼成像matlab
- 医学图像重建作业matlab源码
- 高光谱图像pca分析特征提取
- MATLAB7.x图像处理
- SPECT图像重建与结果分析
- 图像的饱和度,亮度,色调的matlab代
- 系数绝对值最大 图像融合MATLAB算法
- MATLAB多聚焦图像融合将两张到六张不
- matlab实现对两幅图像的叠加
- 世上最牛的23个图像跟踪算法MATLAB程序
- 图像信息熵 matlab M文件
评论
共有 条评论