Image is not "blank". imshow designed so that any double values that are less than 0 are displayed as black, and any values greater than 1 are displayed as white. When calculating the components of the magnitude of an image, you produce double precision images in your code.
Therefore, I highly suspect that since most of your components (if not all) are larger than 1, this gives you a completely white and therefore “clean” image. Now that we have found the problem, however you are not out of the woods yet . Just scaling your components to fit the range [0,1] won't help either. If you do, the DC component of the amplitude range is likely to be so large that it will suppress the rest of the amplitude components of your image. Thus, you will see only one white dot in the middle, and the rest of the image will be black.
It is common practice to apply the log operation to the amplitude spectrum for display, and then scale the values so that they correspond to the range [0,1] :
%// Your code orig_imdata = imread('Original_Image.png'); spec_orig = fft2(double(orig_imdata)); spec_orig2 = abs(spec_orig); spec_img = fftshift(spec_orig2); %// New code spec_img_log = log(1 + spec_img); imshow(spec_img_log,[]);
In the log operation, the huge dynamic range of values is compressed to a smaller range, especially when the values get larger and therefore, naturally scaling to [0,1] this compressed range will give you better visual results.
The reason you add 1 to each component then accepts log to avoid the log(0) operation. If any components of the amplitude are equal to zero, this will be evaluated to log(1) , which will be equal to 0. After that, you can use imshow(...,[]) to scale the display so that the smallest component is up to 0, and largest component to 1 from the spectrum of log . Please note that I did not change the original spectrum so that you can process it. In addition, the rescaling performed by imshow is completely performed internally for the call. It does not rescale the data in any way - it does this only to display and what.
Let him know how this happens.