img=imread('D:\qwe\123.jpg');
subplot(2,3,1),imshow(img);title('原图像');
f=rgb2gray(img);
subplot(2,3,2),imshow(f);title('傅里叶变换图像');
F=fft2(f);
FS=fftshift(F);
f=fft2(img);
f=fftshift(f);
r=real(f);
i=imag(f);
margin=log(abs(f));
phase=angle(f)*180/pi;