如何在 MATLAB 中绘制 2D 图像傅里叶变换的相位和幅度?
我使用 angle
和 abs
,然后使用 imshow
,但我得到了黑色图像。
在此绘图中 fftshift
有什么用?
最佳答案
F = fft2(I); where I is the input
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
试试这个。代码取自:How to plot a 2D FFT in Matlab?
关于image - 绘制相位和幅度图像傅里叶,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22235080/