img = cdata;
subplot(2,2,1),imshow(img);
title('原图'); f=rgb2gray(img);
subplot(2,2,2),imshow(f);
title('傅里叶变换'); %二维傅里叶变换
F=fft2(f); %======傅里叶变换
FS=fftshift(F);%======将变换的频率图 %频谱
S=0.5*log(1+abs(FS));
subplot(2,2,3);imshow(S,[]) ;
title('直接变换频谱图');; %% 二维傅里叶逆变换
fr=real(ifft2(ifftshift(FS)));%===频域的图反变
ret=im2uint8(mat2gray(fr)); %===取其灰度图
subplot(2,2,4),imshow(ret);
title('逆傅里叶变换');
matlab 图像fft
最新推荐文章于 2024-05-11 10:00:52 发布