且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Matlab中绘制2D FFT?

更新时间:2021-07-27 05:36:01

假设是您的输入图像并且 F 是它的傅立叶变换(即 F = fft2(I)

Assuming that I is your input image and F is its Fourier Transform (i.e. F = fft2(I))

你可以使用此代码:

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