MATLAB Answers

César  Sartori

Having some trouble with 2-D Image Fourier Transform

Asked by César Sartori
on 7 Jan 2013

Hi Everybody!

I'm trying to perform a 2-D Fourier Transform of an image, but I'm not getting it as I'm getting using ImageJ app. When I did it using Matlab, I've got a spectrum having much more high intensity components than when I used the imageJ. I believe there is some mistake when I call the image file to Matlab, but i can't realize it. Can someone help me please?

There's the code:

A = imread('lesao.jpg');      % when I did it, i got an 100x100 uint8 image 
B = im2double(A);
fourier = abs(fftshift(fft2(B,256,256)));


There's the two spectrums:

first, the spectrum gotten by imageJ

then, the matlab spectrum:




No products are associated with this question.

1 Answer

Answer by Image Analyst
on 7 Jan 2013


imshow(fourier, []);


I tried it, but it remains as previously :/

Are both imageJ and MATLAB displaying the same thing? Why don't you use the variable editor to look at the real and imaginary parts. Any why don't you display the real and imaginary parts separately?

Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!