[英]Plotting phase and magnitude image Fourier
如何在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
嘗試這個。 代碼取自: 如何在Matlab中繪制2D FFT?
從您的評論中,您需要刪除直流偏移。 就像是:
imagesc(abs(fftshift(fft2(I - mean(I(:))))));
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.