資源簡(jiǎn)介
沖擊濾波模型是一種用于圖像邊緣增強(qiáng)的常用算法
代碼片段和文件信息
function?outIm?=?CoherenceESF(IKdetn)
%n??--?迭代次數(shù)
I?=?double(I);
%Kdet?=?1;??%%Kdet決定了目標(biāo)紋理結(jié)構(gòu)的尺寸大小,一般取0.5到2,對(duì)處理結(jié)果影響很大
h?=?1;??%空間步長(zhǎng)
dett?=?0.1;
for?k?=?1:n
k
%|detI|
%計(jì)算Ii+1j
temp1?=?ijTrans(I0);
%計(jì)算?Ii-1,j
temp2?=?ijTrans(I1);
%計(jì)算?Ii,j+1
temp3?=?ijTrans(I2);
%計(jì)算Ii,j-1
temp4?=?ijTrans(I3);
Ix?=?sqrt(min((I?-?temp2)/h0).^2?+?max((temp1-I)/h0).^2);
Iy?=?sqrt(min((I?-?temp4)/h0).^2?+?max((temp3-I)/h0).^2);
detI?=?sqrt(Ix.^2?+?Iy.^2);
%計(jì)算Ii+1j+1
temp13?=?ijTrans(temp12);
%計(jì)算Ii-1j-1
temp24?=?ijTrans(temp23);
%計(jì)算Ii+1j-1
temp14?=?ijTrans(temp13);
%計(jì)算Ii-1j+1
temp23?=?ijTrans(temp22);
Ix?=?(temp1?-?temp2)/(2*h);
Iy?=?(temp3?-?temp4)/(2*h);
Ixx?=?(temp1?+?temp2?-?2*I)/(h*h);
Iyy?=?(temp3?+?temp4?-?2*I)/(h*h);
Ixy?=?(temp13?+?temp24?-?temp14?-?temp23)/(4*h*h);
Gxx?=?Kdet*Ixx;
Gxy?=?Kdet*Ixy;
Gyy?=?Kdet*Iyy;
Kp?=?3*Kdet;
J11?=?Kp*Ix.*Ix;
J12?=?Kp*Ix.*Iy;
J21?=?Kp*Ix.*Iy;
J22?=?Kp*Iy.*Iy;
w1?=?2*J12./sqrt(?4*J12.^2?+?(J22?-?J11?+?sqrt((J11-J22).^2?+?4*J12.^2)).^2?+?eps);
w2?=?(J22?-?J11?+?sqrt((J11-J22).^2+4*J12.^2))./sqrt(4*J12.^2?+?(J22?-?J11?+?sqrt((J11-J22).^2?+?4*J12.^2)).^2?+?eps);
Gww?=?w1.^2.*Gxx?+?2*w1.*w2.*Gxy?+?w2.^2.*Gyy;
Inew?=?I?-?dett*sign(Gww).*detI;
if?min(min(Inew))<=0
????break;
end
I?=?Inew;
end
outIm?=?Inew?;?
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????1375??2011-06-21?14:44??沖擊濾波器\CoherenceESF.m
?????文件???????2258??2011-06-21?14:41??沖擊濾波器\GilboaSZ.asv
?????文件???????2258??2011-06-21?14:44??沖擊濾波器\GilboaSZ.m
?????文件????????649??2011-03-01?09:27??沖擊濾波器\ijTrans.m
?????目錄??????????0??2012-08-28?20:25??沖擊濾波器
-----------?---------??----------?-----??----
?????????????????6540????????????????????5
評(píng)論
共有 條評(píng)論