简体   繁体   中英

Inverse Fourier transform in matlab for amplitude

I have an image which is the amplitude of the Fourier transformation. I tried ifft but it does't work (I have a black image). So how can I do this?

I get this message:

Warning: Displaying real part of complex input.    

This is a piece of my code:

F=fft2(img);
F = fftshift(F);
F = abs(F);
F = log(F+1);
F = mat2gray(F);
F=ifft2(F);
imshow(F)

The idea is to take a picture of me and to do a Fourier transformation of it. Next, I cut the center of the Fourier transformation. I want to see how my picture looks like.

I think you just got the order wrong, let me know if this work

img = imread('whatever.png');
F = abs(fft2(img));
F = log10(1+F); 
F= fftshift(F);
imshow(F,[]);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM