绘制相位和幅度图像傅里叶

时间:2014-03-06 20:20:29

标签: image matlab plot fft phase

如何在MATLAB中绘制2D图像的傅立叶变换的相位和幅度? 我使用angleabs,然后使用imshow,但我得到一张黑色图片。
在这个绘图中fftshift有什么用?

2 个答案:

答案 0 :(得分:1)

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?

答案 1 :(得分:1)

根据您的评论,您需要删除DC偏移。 类似的东西:

imagesc(abs(fftshift(fft2(I - mean(I(:))))));