MATLAB中逆滤波问题重建图像

时间:2016-11-06 08:24:42

标签: image matlab image-processing

我使用了传递功能'运动'来自空间域中的imnoise。 现在我尝试在频域中对其进行去卷积,但它无法正常工作! 我的代码在这里:

clc 
close all
clear

display('Welcome to wiener and invert reconstruction image ...');

path = input('Enter pictures path:','s');
info=imfinfo(path);
resolution=info.Width*info.Height;
i=imread(path);

if strcmpi(info.ColorType,'truecolor')
   i=rgb2gray(i);
end

psf=fspecial('motion',70,45);
f=imfilter(single(i),psf);

%f=imnoise(f,'gaussian',0,0.001);

%invert filtering
PQ=paddingsize([info.Height info.Width],'pwr');
F=fft2(  single(f) ,PQ(1),PQ(2)  );
PSF=fft2(  psf ,PQ(1),PQ(2)  );
Fhat=F./PSF;
fhat=ifft2(Fhat);
imshow(fhat(1:info.Height,1:info.Width));

2 个答案:

答案 0 :(得分:1)

您可以尝试使用维纳滤波器代替此逆滤波器Fhat = F. / PSF来减小噪声放大的影响。

答案 1 :(得分:0)

代码是正确的,但有一些噪音放大。 更多细节在: http://blogs.mathworks.com/steve/2007/08/13/image-deblurring-introduction/

相关问题