matlab中,关于图像复原中的维纳滤波问题
发布网友
发布时间:2022-04-29 01:35
我来回答
共1个回答
热心网友
时间:2022-06-27 18:13
clear;
I=imread('img_orignal.tif');
figure;
subplot(2,2,1);imshow(I);title('
原图像
');
[m,n]=size(I);F=fftshift(fft2(I));
k=0.005;
for u=1:m
for v=1:n
H(u,v)=exp((-k)*(((u-m/2)^2+(v-n/2)^2)^(5/6)));
end
end
G=F.*H;
I0=real(ifft2(fftshift(G)));
I1=imnoise(uint8(I0),'gaussian',0,0.001)
subplot(2,2,2);imshow(uint8(I1));title('模糊退化且添加高斯噪声的图像');
F0=fftshift(fft2(I1));
K=0.1;
for u=1:m
for v=1:n
H(u,v)=exp(-k*(((u-m/2)^2+(v-n/2)^2)^(5/6)));
H0(u,v)=(abs(H(u,v)))^2;
H1(u,v)=H0(u,v)/(H(u,v)*(H0(u,v)+K));
end
end
F2=H1.*F0;
I2=ifft2(fftshift(F2));
subplot(2,2,3);imshow(uint8(I2));title('维纳滤波复原图');