Lena Image Fourier Transform

11 views (last 30 days)
Algorithms Analyst
Algorithms Analyst on 20 Sep 2012
Can any one transform the image into its fourier transformation using matlab?
Thanks

Answers (2)

Wayne King
Wayne King on 20 Sep 2012
Edited: Wayne King on 20 Sep 2012
Yes, use fft2()
This question seems identical (but with less detail) to this one:
It is not good practice to simply keep creating a new thread for the same question. I think you will get much more help if you show what you have tried; the code you have written.
  6 Comments
Algorithms Analyst
Algorithms Analyst on 21 Sep 2012
my code is here.
imageA=imread('lena.bmp');
figure,imshow(imageA)
title('Original Grayscale Lena Image');
imageA=double(rgb2gray(imageA));
fftA=fft2(imageA);
figure,imagesc(abs(fftshift(fftA)));
colormap gray;
imagesc(log(abs(fftshift(fftA))));
title('RGB lena Image Magnitude throught Fourier Transforms');
figure,imshow(angle(fftshift(fftA)),[-pi,pi]),colormap gray
title('RGB Lena Image Phase through fourier transform');
fftB = abs(fftA).*exp(i*angle(fftA));
imageB=ifft2(fftB);
cmin=min(min(abs(imageB)));
cmax=max(max(abs(imageB)));
figure,imshow(abs(imageB),[cmin cmax]); colormap in2rgb;
Walter Roberson
Walter Roberson on 21 Sep 2012
There is no colormap named "in2rgb"

Sign in to comment.


Dr. Deepak Kumar Rout
Dr. Deepak Kumar Rout on 21 Sep 2012
to the above code you have to add syntax so as to multiply (-1)^(x+y) that will center the low frequency components
  12 Comments
Image Analyst
Image Analyst on 23 Sep 2012
I think you misunderstood. I did not ask "Did this code work?", I asked "What about the code did not work?". In other words, I assume you tried what I suggested and am asking why it didn't work, for example you had an error message or unexpected results and what was the error message or unexpected result.
Usually people try to help people who are trying to help them. One word answers tell people that they're not interested in investing enough time to allow people to help them, which leads us volunteers to not help. I can't solve problems with single words so if you give them, and want responses just as terse, then I'm not your man. You get what you give.
Algorithms Analyst
Algorithms Analyst on 24 Sep 2012
I can understand you.may be you are right.But where should I integrate this code
fftofChannel=fft(redchannel)
where should I integrate it with my code.As fftB = abs(fftA).*exp(i*angle(fftA)); imageB=ifft2(fftb)
where should I add it. Thanks

Sign in to comment.

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!