clear all; close all; clc; %title('Fourier Transform','positon'); f = zeros(30,30); f(5:24,13:17) =1; subplot(2,2,1); imshow(f,'InitialMagnification','fit'); title('Gray Image'); F = fft2(f); F1 = log(abs(F)); subplot(2,2,2); imshow(F1,[-1 5],'InitialMagnification','fit'); title('DFT Computed Without Padding'); colormap(jet); colorbar; F2 = fft2(f,256,256); subplot(2,2,3); imshow(log(abs(F2)),[-1,5]); title('DFT Computed With Padding'); colormap(jet); colorbar; F3 = fftshift(F2); subplot(2,2,4); imshow(log(abs(F3)),[-1,5]); title('DFT Computed With Padding and Sfit'); colormap(jet); colorbar;输出结果:
关于Image Engineering & Computer Vision的更多讨论与交流,敬请关注本博和新浪微博songzi_tea.