2

私は逆フィルタリングを勉強していて、それをコーディングしようとしていて、ネットからいくつかの参考文献を探しました。私が言及しているゴンザレスの本のどこにも見られない光伝達関数を誰もが考えてきました。

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

1 に答える 1

7

あなたの質問は不明確であり、おそらく(dsp.stackexchange.com)の方が適切です。しかし、「光学伝達関数とは何ですか?」という質問がある場合は、その場合は、OTFに関するウィキペディアの記事から始めるのが適切です。

これについて考える最も簡単な方法は、光学伝達関数が点広がり関数 (PSF) のフーリエ変換であるということです。通常、PSF はフィルター (畳み込みカーネル) であり、単一のピンホール タイプの光源が何らかのデバイスを介して実際の画像にどのように染み込むかを表します。

OTF は、スミアリング プロセスの振幅/位相表現にすぎません。これは、画像のフーリエ変換が位相空間で乗算されて、不鮮明な真の出力画像のフーリエ変換を生成するフィルターです(空間ドメインで PSF を使用して行う畳み込みの代わりに)。OTF を適用した後に逆フーリエ変換を適用すると、デバイスが生成する実際の画像が得られます。

数学的便宜上、また場合によっては処理効率のために、通常の空間ドメインの PSF の代わりに OTF を使用する方が便利な場合があります。これが、一部のアルゴリズムや教科書で、PSF ではなく OTF を使用してメソッドが説明されているのを目にする理由です。

于 2012-04-18T21:56:10.487 に答える