我正在学习反向过滤,我试着对它进行编码,我从网上找到了一些参考资料。每个人都考虑了光学传递函数,这在冈萨雷斯书中是看不到的,我指的是。
% Inverse_Filter_Demo-
clc
clear all
close all
original_image=imread('cameraman.jpg'); %loading the original (un-blurred) image
original_image=double(original_image);
%The blur function (PSF- Point Spread Function) that will be added to the original image
PSF=fspecial('motion',20,45);
%Adding blur to the original image
degraded_image = imfilter(original_image,PSF,'circular','conv');
OTF= psf2otf(PSF,[size(degraded_image,1) size(degraded_image,2)]);%Getting OTF from PSF
Inverse_Filter=conj(OTF)./((abs(OTF)).^2); %The inverse filter
%Preforming Fourier Transform to the degraded image
FT_degraded_image=fftn(degraded_image);
%Preforming the restoration itself
restored_image=abs(ifftn(FT_degraded_image.*Inverse_Filter));
%Presenting the restoration results:
figure;
set(gca,'Fontsize',14);
colormap(gray);
imagesc(original_image,[0 255]);
truesize;
title('Original image');
figure;
set(gca,'Fontsize',14);
colormap(gray);
imagesc(degraded_image,[0 255]);
truesize;
title('Degraded image');
figure;
set(gca,'Fontsize',14);
colormap(gray);
imagesc(restored_image,[0 255]);
truesize;
title('Restoration of the degraded image (using Inverse Filter)');发布于 2012-04-18 21:56:10
您的问题不清楚,而且可能更适合(dsp.stackexchange.com)。然而,如果你问的是“什么是光学传递函数?”那么,OTF的维基百科文章是一个很好的起点。
最简单的思考方法是光学传递函数是点扩散函数(PSF)的傅里叶变换。通常,PSF是一种滤波器(卷积核),它描述了单个针洞型光源如何通过某种设备被涂抹到实际图像中。
OTF只是涂片过程的振幅/相位表示。这是滤波器,图像的傅里叶变换将相乘在相空间,以产生涂抹的,真正的输出图像的傅里叶变换(而不是卷积,这是你所做的PSF在空域)。应用逆傅里叶变换后,应用OTF应该会给你实际的图像,设备将产生。
为了数学上的方便,有时也为了处理效率,用OTF代替常规的空间域PSF更方便。这就是为什么你会看到一些算法和教科书用OTF而不是PSF来描述它们的方法。
https://stackoverflow.com/questions/10208234
复制相似问题