当我使用matlab交换2张图像的fft相位并用逆fft重建这2张图像时,我的图像不满意。
我的代码在哪里不正确?
A = imread('1.jpg');
B = imread('2.jpg');
X = rgb2gray(A);
Y = rgb2gray(B);
XF = fft2(X);
YF = fft2(Y);
magA = abs(XF);
phaseA = angle(XF);
magB = abs(YF);
phaseB = angle(YF);
AF = magA.*exp(1i*phaseB);
BF = magB.*exp(1i*phaseA);
Anew = ifft2(AF);
Bnew = ifft2(BF);