Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image 图像复原中的光学传递函数是什么?_Image_Image Processing_Filter - Fatal编程技术网

Image 图像复原中的光学传递函数是什么?

Image 图像复原中的光学传递函数是什么?,image,image-processing,filter,Image,Image Processing,Filter,我正在研究逆滤波,我试图编码它,我从网上找到了一些参考资料。每个人都考虑过光学传递函数,这在冈萨雷斯的书中是看不到的 % 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

我正在研究逆滤波,我试图编码它,我从网上找到了一些参考资料。每个人都考虑过光学传递函数,这在冈萨雷斯的书中是看不到的

% 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)');

您的问题不清楚,可能更适合(dsp.stackexchange.com)。然而,如果你要问的是“什么是光学传递函数?”那么OTFs是一个很好的起点

考虑这一点最简单的方法是,光学传递函数是点扩散函数(PSF)的傅里叶变换。通常PSF是一个滤波器(卷积核),它描述了单个针孔型光源如何通过某种设备被涂抹到实际图像中

OTF只是涂抹过程的振幅/相位表示。它是图像的傅里叶变换在相空间中乘以的滤波器,以产生涂抹的真实输出图像的傅里叶变换(而不是卷积,这是在空间域中使用PSF所做的)。在应用OTF后应用傅里叶逆变换,应该会得到设备将产生的实际图像

为了数学上的方便,有时为了处理效率,使用OTF而不是常规空域的PSF更为方便。这就是为什么你们会看到一些算法和教科书用OTF而不是PSF来描述他们的方法