【发布时间】:2014-06-10 00:56:07
【问题描述】:
我正在实现图像增强代码并应用傅立叶和傅立叶逆变换我正在使用下面的代码,但结果它给出了黑色图像。
F = fft2(image); 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
Y = ifft2(F);
subplot(1,1,1);
imshow(Y,[]); % Display the result
【问题讨论】:
-
许多 fft/ifft 实现最终会以 NxM 缩放结果,让您自己将其缩放回“正常”...我不记得 Matlab 是否是其中之一那些与否......另外,由于你没有做 fft 的 ifft(你已经以几种方式处理了 fft),结果可能不会是你想要的......
-
犯了与this question完全相同的错误。考虑那里的 cmets。
标签: matlab image-processing fft image-enhancement