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

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)));
imshow(fourier)

------------------------------------------

There's the two spectrums:

first, the spectrum gotten by imageJ

then, the matlab spectrum:

Thanks!

0 Comments

César  Sartori

Products

No products are associated with this question.

1 Answer

Answer by Image Analyst on 7 Jan 2013

Try

imshow(fourier, []);

2 Comments

César Sartori on 7 Jan 2013

I tried it, but it remains as previously :/

Image Analyst on 7 Jan 2013

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?

Image Analyst

Contact us