附录Ⅰ
以下是用Matlab实现的程序编码: function image_process_FFT()
[filename, pathname]=uigetfile({'*.jpg;*.tif;*.bmp;*.gif' },'File Selector'); image=imread(strcat(pathname,filename)); scrsz=get(0,'ScreenSize');
figure('position',[0 0 scrsz(3)-1 scrsz(4)]); set(gcf,'Name','快速傅里叶变换'); subplot(2,4,1); imshow(image); title('原始图像'); subplot(2,4,5); imshow(image); title('原始图像'); if ndims(image)==3 image=rgb2gray(image); end
subplot(2,4,2); imshow(image); title('灰度图像'); subplot(2,4,6); imshow(image); title('灰度图像') [r,c]=size(image); array=image; t=log2(r); t1=floor(t); t2=ceil(t); if t1~=t2
array(2^t2,c)=0; end
[r1,c1]=size(array); t=log2(c1); t3=floor(t);