【MATLAB】【图像处理】二维傅里叶变换 E = zeros(200,200); A = zeros(200,200); B = zeros(200,200); E(:,:) = 255; E = uint8(E); A(:,1:100) = 255; A = uint8(A); B(1:100,:) = 255; B = uint8(B); FE = fftshift(fft2(E)); FA = fftshift(fft2(A)); FB = fftshift(fft2(B)); figure(); subplot(3,3,1);imshow(E);title(‘纯白图像’); subplot(3,3,2);imshow(abs(FE));title(‘纯白图像的幅度谱’); subplot(3,3,3);imshow(angle(FE));title(‘纯白图像的相位谱’); subplot(3,3,4);imshow(A);title(‘黑白对半图像1’); subplot(3,3,5);imshow(abs(FA));title(‘黑白对半图像1的幅度谱’); subplot(3,3,6);imshow(angle(FA));title(‘黑白对半图像1的相位谱’); subplot(3,3,7);imshow(B);title(‘黑白对半图像2’); subplot(3,3,8);imshow(abs(FB));title(‘黑白对半图像2的幅度谱’); subplot(3,3,9);imshow(angle(FB));title(‘黑白对半图像2的相位谱’); C = zeros(200,200); D = zeros(200,200); G = zeros(200,200); C(1:100,1:100) = 255; C(101:200,101:200) = 255; FC = fftshift(fft2(C)); for i = 1:200 if mod(i,20) <= 9 D(i,:) = 255; end end FD = fftshift(fft2(D)); for i = 1:200 for j = 1:200 if mod(i,20) <= 9 && mod(j,20) <= 9 G(i,j) = 255; elseif mod(i,20) > 9 && mod(j,20) > 9 G(i,j) = 255; end end end FG = fftshift(fft2(G)); figure(); subplot(3,3,1);imshow(C);title(‘方格图像’); subplot(3,3,2);imshow(abs(FC));title(‘方格图像的幅度谱’); subplot(3,3,3);imshow(angle(FC));title(‘方格图像的相位谱’); subplot(3,3,4);imshow(D);title(‘条纹图像’); subplot(3,3,5);imshow(abs(FD));title(‘条纹图像的幅度谱’); subplot(3,3,6);imshow(angle(FD));title(‘条纹图像的相位谱’); subplot(3,3,7);imshow(G);title(‘棋盘图像’); subplot(3,3,8);imshow(abs(FG));title(‘棋盘图像的幅度谱’); subplot(3,3,9);imshow(angle(FG));title(‘棋盘图像的相位谱’);
2024最新激活全家桶教程,稳定运行到2099年,请移步至置顶文章:https://sigusoft.com/99576.html
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。 文章由激活谷谷主-小谷整理,转载请注明出处:https://sigusoft.com/61820.html