资源简介
这是一个snake模型的算法
希望对大家有帮助
代码片段和文件信息
% EXAMPLE an example of balloon model on the room object
%
% Chenyang Xu and Jerry Prince 6/17/97
% Copyright (c) 1996-97 by Chenyang Xu and Jerry Prince
s = cd; s = [s ‘\snake‘]; path(s path);
help balloon_ex;
% Read in the 64x64 room image
[Imap] = rawread(‘D:\MATLAB704\work\snake2\room.pgm‘);
% Compute its edge map
disp(‘ Compute edge map ...‘);
f = 1 - I/255;
f0 = gaussianBlur(f1);
% note: snake potential is the negative of edge map
disp(‘ Comute the traditional external force ...‘);
[pxpy] = gradient(f0);
% display the results
figure(1);
subplot(121); imdisp(-f); title(‘snake potential‘);
subplot(122); quiver(pxpy);
axis(‘image‘ ‘ij‘ ‘off‘); % fix the axis
title(‘traditional force‘);
% balloon deformation
disp(‘ ‘);
disp(‘ Press any key to start the deformation‘);
pause;
figure(1); subplot(121);
colormap(gray(64));
image(((1-f)+1)*40); axis(‘square‘ ‘off‘);
t = 0:0.5:6.28;
x = 32 + 3*cos(t);
y = 32 + 3*sin(t);
[xy] = snakeinterp(xy20.5);
snakedisp(xy‘r‘)
pause(1);
for i=1:15
[xy] = snakedeform2(xy0.0501 2 0.15pxpy5);
[xy] = snakeinterp(xy20.5);
snakedisp(xy‘r‘)
title([‘Deformation in progress iter = ‘ num2str(i*5)])
pause(0.5);
end
disp(‘ ‘);
disp(‘ Press any key to display the final result‘);
pause;
figure(1); subplot(121);
colormap(gray(64));
image(((1-f)+1)*40); axis(‘square‘ ‘off‘);
snakedisp(xy‘r‘);
title([‘Final result iter = ‘ num2str(i*5)]);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1643 2007-05-21 10:25 snake2\balloon_ex.asv
文件 1775 2007-05-15 20:39 snake2\balloon_ex.m
文件 112 2007-05-21 11:13 snake2\biany.m
文件 1002056 2007-05-21 10:57 snake2\bianyuan.bmp
文件 916 1999-12-13 13:41 snake2\BoundMirrorEnsure.m
文件 699 1999-09-28 08:58 snake2\BoundMirrorExpand.m
文件 488 1999-09-28 08:58 snake2\BoundMirrorShrink.m
文件 2088 2007-05-14 16:12 snake2\cheng1.asv
文件 2088 2007-05-14 15:58 snake2\cheng1.m
文件 1162 2007-05-14 16:12 snake2\cheng2.asv
文件 1259 2007-05-14 16:00 snake2\cheng2.m
文件 845 2007-05-15 09:10 snake2\cheng3.asv
文件 1039 2007-05-15 09:12 snake2\cheng3.m
文件 1096 1999-09-28 08:58 snake2\Contents.m
文件 835 2005-03-18 15:00 snake2\del3.m
文件 2043 1999-09-28 08:58 snake2\distance_ex.m
文件 608 1999-09-28 08:58 snake2\dt.m
文件 545 2007-05-12 15:07 snake2\gaussianBlur.asv
文件 432 2007-05-12 15:08 snake2\gaussianBlur.m
文件 281 2007-05-12 09:17 snake2\gaussianMask.asv
文件 281 2007-05-12 09:19 snake2\gaussianMask.m
文件 1637 1999-09-28 08:58 snake2\GVF.m
文件 2890 2007-05-11 10:31 snake2\gvf_ex.asv
文件 2892 2007-05-15 20:36 snake2\gvf_ex.m
文件 252 1999-09-28 08:58 snake2\imdisp.m
文件 1703 2005-05-09 20:06 snake2\isoGVF.m
文件 335 2007-05-14 15:36 snake2\lunkuo.m
文件 263222 2007-04-28 11:20 snake2\mri1.bmp
文件 262190 2007-05-21 20:29 snake2\mri11.pgm
文件 1956 2005-03-18 12:33 snake2\NGVF.m
............此处省略25个文件信息
- 上一篇:AMI编码、解码system view仿真
- 下一篇:Verilog 控制12864
评论
共有 条评论