• 大小: 277KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-18
  • 语言: Matlab
  • 标签: snake  

资源简介

利用snake蛇形算法进行边缘检测的matlab程序,可对二维图像进行边缘检测。需手动初始化边缘。

资源截图

代码片段和文件信息

function coe = cal_coefficient(Dlsrthita)
%D:换能器宽度
%L:换能器平面距血管的距离;
%r:被校正点对应半径
%thita:被校正点对应角度
z1=1.632;%1.686
z2=1.656;
c1=1540;
c2=1570;
% rou1=1.016;%1.084
% rou2=1.686;
% L=ls-r*(1-sin(thita));
%计算校正系数的时候归到第一象限
if(0    thita=thita;
   elseif(thita<=pi)
    thita=pi-thita;
   elseif(thita<=pi*3/2)
    thita=thita-pi;
   else
    thita=2*pi-thita;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% thita_in=thita;
% if(sin(thita_in)*(c2/c1)<0.8)
%         thita_r=asin(sin(thita_in).*(c2/c1));
%         reflect1=z2*cos(thita_in)-z1*cos(thita_r);
%         reflect2=z2*cos(thita_in)+z1*cos(thita_r);
%         reflect=sum(reflect1/reflect2)*0.01;
%     else
%         reflect=0.8;
% end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
dthita=0.05;
thita_in=thita-dthita:0.01:thita+dthita;
if(thita+dthita        thita_r=asin(sin(thita_in).*(c2/c1));
        reflect1=z2.*cos(thita_in)-z1.*cos(thita_r);
        reflect2=z2.*cos(thita_in)+z1.*cos(thita_r);
        reflect=sum(reflect1./reflect2)*0.01;
    else
        reflect=0.8;
end
reflect0=(z2-z1)/(z2+z1);
coe=(1-reflect0)/(1-reflect);
% thita1=pi/2-thita-atan(D*sin(thita)/(4*ls*sin(thita)+D*cos(thita)));
% thita2=pi/2-thita+atan(D*sin(thita)/(4*ls*sin(thita)-D*cos(thita)));
% lambda=1540e-7;
% n=32;   % 阵元数目
% d=0.0003048;
% D_thita=thita1:0.01:thita2;
% Ds=abs((sin(n*pi*d*sin(D_thita)/lambda))./((n*sin(pi*d*sin(D_thita)/lambda))));
% u=sum(Ds)*0.01;
% thita0=atan(D/(4*L))
% D_thita0=0.001:0.01:thita0;
% Ds0=abs((sin(n*pi*d*sin(D_thita0)/lambda))./((n*sin(pi*d*sin(D_thita0)/lambda))));
% u0=2*sum(Ds0)*0.01;
% %计算反射系数
% thita_in=pi/2-thita;
% thita_r=asin(sin(thita_in)*(c2/c1));
% reflect(i)=abs((z2*cos(thita_in)-z1*cos(thita_r))/(z2*cos(thita_in)+z1*cos(thita_r)));
% reflect0=(z2-z1)/(z2+z1);
% % coe=u;
% coe=reflect0*u0/(reflect*u)

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      49206  2008-04-15 21:50  snake_demo\001.bmp

     文件       1969  2010-03-12 10:38  snake_demo\cal_coefficient.asv

     文件       1977  2010-03-12 15:10  snake_demo\cal_coefficient.m

     文件       5007  2010-03-11 15:21  snake_demo\GVF_Snake.asv

     文件       5033  2010-03-11 16:34  snake_demo\GVF_Snake.m

     文件       3198  2010-03-01 18:06  snake_demo\GVF_Snake11.asv

     文件       3198  2010-03-01 18:11  snake_demo\GVF_Snake11.m

     文件      31456  1998-10-02 08:33  snake_demo\head.jpg

     文件      14125  2010-01-27 15:23  snake_demo\hs_err_pid2812.log

     文件      47490  1999-01-06 13:49  snake_demo\images\chest.pgm

     文件       1064  1998-09-30 09:50  snake_demo\images\heart.mat

     文件      25615  1998-09-29 10:01  snake_demo\images\heart.pgm

     文件       3563  2010-01-25 21:24  snake_demo\images\heart11.mat

     文件       4248  1998-09-30 09:58  snake_demo\images\heart2.mat

     文件       4056  1998-10-01 06:18  snake_demo\images\heart3.mat

     文件      65594  1999-01-06 13:32  snake_demo\images\new.pgm

     文件       2792  1998-09-30 10:26  snake_demo\images\room.mat

     文件       4109  1997-08-28 12:32  snake_demo\images\room.pgm

     文件       2928  1998-09-30 09:43  snake_demo\images\room2.mat

     文件       2928  1998-09-30 09:44  snake_demo\images\room3.mat

    ..A.SH.      7680  2010-01-26 15:57  snake_demo\images\Thumbs.db

     文件       3304  1998-10-01 06:20  snake_demo\images\u64.mat

     文件       4109  1997-08-28 12:32  snake_demo\images\U64.pgm

     文件       2952  1998-10-07 04:51  snake_demo\images\u642.mat

     文件        135  2010-03-03 09:31  snake_demo\intme.m

     文件       1552  2010-03-03 19:34  snake_demo\jiaozheng.asv

     文件       1565  2010-03-12 09:49  snake_demo\jiaozheng.m

     文件       3798  2009-09-29 16:45  snake_demo\sdemo.m

     文件      49206  2010-01-27 16:51  snake_demo\snake\001.bmp

     文件        916  2009-09-21 11:00  snake_demo\snake\BoundMirrorEnsure.m

............此处省略66个文件信息

评论

共有 条评论