Assuming that I
is your input image and F
is its Fourier Transform (i.e. F = fft2(I)
)
You can use this code:
F = fftshift(F); % Center FFT
F = abs(F); % Get the magnitude
F = log(F+1); % Use log, for perceptual scaling, and +1 since log(0) is undefined
F = mat2gray(F); % Use mat2gray to scale the image between 0 and 1
imshow(F,[]); % Display the result
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…