matlab练习程序(图像傅里叶变换,幅度谱,相位谱)

原文地址为: matlab练习程序(图像傅里叶变换,幅度谱,相位谱)

cl;
img=imread('15.bmp');
%img=double(img);
f=fft2(img); %傅里叶变换
f=fftshift(f); %使图像对称
r=real(f); %图像频域实部
i=imag(f); %图像频域虚部
margin=log(abs(f)); %图像幅度谱,加log便于显示
phase=log(angle(f)*180/pi); %图像相位谱
l=log(f);
subplot(2,2,1),imshow(img),title('源图像');
%subplot(2,2,2),imshow(l,[]),title('图像频谱');
subplot(2,2,3),imshow(margin,[]),title('图像幅度谱');
subplot(2,2,4),imshow(phase,[]),title('图像相位谱');

转载请注明本文地址: matlab练习程序(图像傅里叶变换,幅度谱,相位谱)

猜你喜欢

转载自blog.csdn.net/linjcai/article/details/81780266