FFT of an image

4 ビュー (過去 30 日間)
Jim
Jim 2012 年 5 月 9 日
Hi,
I need to apply the following conditions to remove blur in an image?
1.Load the image
2.compute fft of an image
3.shift frequency components to the center
4.define low pass filter
5.shift the filter to the center
6.Apply filter to the shifted fourier transformed image
7.inverse shift
8.inverse fourier transform
My code look like this:
i = imread('L3S3T1.jpg');
i = double(rgb2gray(i));
I = fftshift(fft(double(i)));
What does fftshift will do exactly?
Does it shift the frequency components to center
I strucked with defining a low pass
How to define it?
How to move it to the center
Thanks in advance

採用された回答

Image Analyst
Image Analyst 2012 年 5 月 9 日
Perhaps discuss with your professor some about how Fourier filtering works. He can tell you that to "remove blur in an image" you do not want to apply low pass filtering. Once you blurred it, the high frequencies are gone, or at least altered/attenuated. You can try to extract the high frequencies that remain, say for example by convolving with a kernel that has negative weights. This is the same as subtracting a blurred image from the original and called (confusingly) "unsharp masking" But your code or algorithm just blurs your already blurred image - that won't remove blur. Doing unsharp masking by blurring an already blurred image, and then subtracting it from the first blurred image will show you what high frequencies remain in the blurred image, but it will not restore them and will not get you any closer to your original image before it was blurred. Like I said before, I think you're trying to do your own version of a Wiener filter but not going about it right.
  2 件のコメント
Jim
Jim 2012 年 5 月 9 日
Thank you for ur reply?
What exactly I need to do is unsharp masking?
How to write an algorithm to remove blur version of image from original image by unsharp masking.
Thanks in advance
Image Analyst
Image Analyst 2012 年 5 月 9 日
You can do it with conv2() or imfilter().

サインインしてコメントする。

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 5 月 9 日
Using a low-pass filter on the frequency components will not do you any good at all. Either low-pass filter the image itself, or just zero the frequency components corresponding to high frequencies.
  2 件のコメント
Jim
Jim 2012 年 5 月 9 日
Thanks for ur reply
So, filter cannot be applied to remove blurrness in the image
What does fftshift will do exactly to fourier transformed image
Is there any better method to remove blurrness in an image?
Thanks in advance
Walter Roberson
Walter Roberson 2012 年 5 月 9 日
What I said is that you do not apply the low-pass filter to the *frequency* components (that is, to the output of the fft)
But see IA's response about blur, which is better than mine (I'd been up far far too late in the night.)

サインインしてコメントする。

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by