资源简介
极化SAR精致Lee滤波;基于散射特性的滤波算法;Lee滤波算法代码;
代码片段和文件信息
%相干斑噪声滤波器(speckle filter)
clear;
sp = load(‘span.mat‘‘span‘);
row = 900;
col = 1024;
%%
%最小均方误差滤波器
% k = 9;%表示滤波器窗口大小
% selta = 0.1;
% mmse = zeros(rowcol);
% for m = 1:row
% for n = 1:col
% Span = sp.span;
% I = img_scan(kmnrowcolSpan);
% y_m = mean(mean(I));%后向散射均值
% y_v = std(I(:))^2;%后向散射的方差
% b = (y_v-y_m*selta^2)/(1+selta^2)/y_v;
% if b>1|b<0 b = 0;end
% mmse(mn) = y_m+b*(Span(mn)-y_m);
% end
% end
% figure(1)imshow(histeq(mmse));
% title(‘最小均方误差滤波算法(mmse)窗口大小9*9selta = 0.1‘);
%%
%均值滤波Meanfilter(处理span图像)
% k = 5;%表示滤波器窗口大小
% mea = zeros(rowcol);
% for m = 1:row
% for n = 1:col
% Span = sp.span;
% I = img_scan(kmnrowcolSpan);
% mea(mn) = mean(mean(I));
% end
% end
% imshow(histeq(mea));
% title(‘均值滤波算法(5x5)-span‘);
%%
%精改的Lee极化SAR相干斑滤波
c3 = load(‘c3.mat‘‘C3‘);
k = 7;%边界对齐窗的尺寸
Span = sp.span;
lee = zeros(rowcol);
maxd = zeros(rowcol);
selta = 0.36;
%四个方向模板
dir(::1) = [-101;-101;-101];
dir(::2) = [011;-101;-1-10];
dir(::3) = [111;000;-1-1-1];
dir(::4) = [110;10-1;0-1-1];
d = zeros(14);
%边界对齐窗
win(::1) = [0001111;0001111;0001111;0001111;0001111;0001111;0001111];
win(::2) = [1111111;0111111;0011111;0001111;0000111;0000011;0000001];
win(::3) = [1111111;1111111;1111111;1111111;0000000;0000000;0000000];
win(::4) = [1111111;1111110;1111100;1111000;1110000;1100000;1000000];
win(::5) = [1111000;1111000;1111000;1111000;1111000;1111000;1111000];
win(::6) = [1000000;1100000;1110000;1111000;1111100;1111110;1111111];
win(::7) = [0000000;0000000;0000000;1111111;1111111;1111111;1111111];
win(::8) = [0000001;0000011;0000111;0001111;0011111;0111111;1111111];
w = 0;
for m = 1:row
for n = 1:col
I = img_scan(kmnrowcolSpan);
s = size(I);
if s(1)~=k|s(2)~=k%对于窗口大小不是k*k的窗口直接进行最小均方误差滤波
y_m = mean(mean(I));%后向散射均值
y_v = std(I(:))^2;%后向散射的方差
B(mn) = (y_v-y_m*selta^2)/(1+selta^2)/y_v;
if B(mn)>1|B(mn)<0 B(mn) = 0;end
lee(mn) = y_m+B(mn)*(Span(mn)-y_m);
else
%判断边界对齐窗的方向
I_1 = [sum(sum(I(1:31:3)))sum(sum(I(1:33:5)))sum(sum(I(1:35:7)))];
I_2 = [sum(sum(I(3:51:3)))sum(sum(I(3:53:5)))sum(sum(I(3:55:7)))];
I_3 = [sum(sum(I(5:71:3)))sum(sum(I(5:73:5)))sum(sum(I(5:75:7)))];
I_33 = [I_1;I_2;I_3]./9;
- 上一篇:555定时器测电容
- 下一篇:人眼检测相关论文,可以参考一下
评论
共有 条评论