资源简介
gauss-gamma双窗函数,针对含有相干斑噪声的sar图像,计算图像的梯度强度和方向
代码片段和文件信息
function [ESMmaxEDM]=gauss_gamma(I)
%made by 白国乐,2017/6/20
%双窗函数滤波,计算sar图像的梯度强度和梯度方向
[mn]=size(I);
a=2; %a是双窗间距
c=2; %c是gauss向窗口长度参数 x向,横向
b=2; %b是gamma向窗口宽度参数 y向,竖向
global p q;
p=5;q=5; %pq分别是单窗的行数和列数
%%%%%%%%%%%%%%%%%%%%%%%%%%%% W01W02
W0=[];
for x=-p:1:p
for y=-q:1:q
W=abs(y)^(a-1)/(sqrt(2*pi)*c*gamma(a)*b^a)*exp(-(x^2/(2*c^2)+abs(y)/b));
W0=[W0W];
end
end
W0=reshape(W02*p+12*q+1); W01=W0;W02=W0;
for i=p+1:2*p+1
for j=1:2*q+1
W01(ij)=0;
end
end
for i=1:p+1
for j=1:2*q+1
W02(ij)=0;
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%% W11W12
W1=[];
for x=-p:1:p
for y=-q:1:q
x1=x*cos(pi/4)-y*sin(pi/4);y1=x*sin(pi/4)+y*cos(pi/4);
W=abs(y1)^(a-1)/(sqrt(2*pi)*c*gamma(a)*b^a)*exp(-(x1^2/(2*c^2)+abs(y1)/b));
W1=[W1W];
end
end
W1=reshape(W12*p+12*q+1); W11=W1;W12=W1;
for i=1:2*p+1
for j=1:2*q+1
if i+j>=p+q+2
W11(ij)=0;
end
end
end
for i=1:2*p+1
for j=1:2*q+1
if i+j<=p+q+2
W12(ij)=0;
end
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%% W21W22
W2=[];
for x=-p:1:p
for y=-q:1:q
x2=x*cos(pi/2)-y*sin(pi/2);y2=x*sin(pi/2)+y*cos(pi/2);
W=abs(y2)^(a-1)/(sqrt(2*pi)*c*gamma(a)*b^a)*exp(-(x2^2/(2*c^2)+abs(y2)/b));
W2=[W2W];
end
end
W2=reshape(W22*p+12*q+1); W21=W2;W22=W2;
for i=1:2*p+1
for j=q+1:2*q+1
W21(ij)=0;
end
end
for i=1:2*p+1
for j=1:q+1
W22(ij)=0;
end
end
%%%%%%%%%%%%%%%%%%%%%%%%% W31W32
W3=[];
for x=-p:1:p
for y=-q:1:q
x3=x*cos(3*pi/4)-y*sin(3*pi/4);y3=x*sin(3*pi/4)+y*cos(3*pi/4);
W=abs(y3)^(a-1)/(sqrt(2*pi)*c*gamma(a)*b^a)*exp(-(x3^2/(2*c^2)+abs(y3)/b));
W3=[W3W];
end
end
W3=reshape(W32*p+12*q+1); W31=W3;W32=W3;
for i=1:2*p+1
for j=1:2*q+1
if i<=j
W31(ij)=0;
end
end
end
for i=1:2*p+1
for j=1:2*q+1
if i>=j
W32(ij)=0;
end
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% W41W42
W4=[];
for x=-p:1:p
for y=-q:1:q
x4=x*cos(pi)-y*sin(pi);y4=x*sin(pi)+y*cos(pi);
W=abs(y4)^(a-1)/(sqrt(2*pi)*c*gamma(a)*b^a)*exp(-(x4^2/(2*c^2)+abs(y4)/b));
W4=[W4W];
end
end
W4=reshape(W42*p+12*q+1); W41=W4;W42=W4;
for i=p+1:2*p+1
for j=1:2*q+1
W41(ij)=
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6904 2018-03-13 16:25 gauss_gamma.m
文件 221 2017-06-20 14:31 main.m
文件 172632 2017-06-07 15:50 边缘检测test.png
- 上一篇:labview串口读写
- 下一篇:低频信号发生器使用说明
评论
共有 条评论