MATLAB: Magnitude not showing up

image processingImage Processing Toolbox

Hey everyone, I found this code on a website and a simplified version is:
%2D FFT Demo
close all;
clear all;
%Import images
imageA = imread('greekchurch.jpg');
%Display images
figure, imshow(imageA)
title('Image A - Greek Church')
%Perform 2D FFTs
fftA = fft2(double(imageA));
%Display magnitude and phase of 2D FFTs
figure, imshow(abs(fftshift(fftA)),[24 100000]), colormap gray
title('Image A FFT2 Magnitude')
When I run it, the image output is white. Anyone know whats wrong?

Best Answer

Try
imshow(abs(fftshift(fftA)),[]);
Or, to compress the scale,
imshow(log(abs(fftshift(fftA))), []);
Related Question