关键词:
实验1 :
>> f=imread('fouriertest.jpg');
>> imshow(f,'notruesize')
Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
Use IMSHOW(...,'InitialMagnification','fit') instead.
> In imshow>preParseInputs at 293
In imshow at 149
>> F=fft2(f);
Warning: FFTN on values of class UINT8 is obsolete.
Use FFTN(DOUBLE(X)) or FFTN(SINGLE(X)) instead.
> In uint8.fftn at 10
In fft2 at 19
>> mesh(fftshift(abs(F)));
这就是fft变换后的频谱图;
>> F2=fftshift(log(abs(F)));
>> imshow(F2,[-1,5],'notruesize');%显示频谱图像,频谱的零频率系数被移至频率中间
Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
Use IMSHOW(...,'InitialMagnification','fit') instead.
> In imshow>preParseInputs at 293
In imshow at 149
f=zeros(1000,1000);
f(350:649,475:524)=1;
f=imrotate(f,45,'bilinear','crop');
imshow(f,'notruesize');
Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
Use IMSHOW(...,'InitialMagnification','fit') instead.
In imshow>preParseInputs at 293
In imshow at 149
>> title('图像正向旋转45°');
>> subplot(224)
>> F=fftshift(abs(fft2(f)));
>> imshow(F,[-1 5],'notruesize');
Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
Use IMSHOW(...,'InitialMagnification','fit') instead.
> In imshow>preParseInputs at 293
In imshow at 149
>>
>> f=zeros(1000,1000);
f(50:349,475:524)=1;
imshow(f, 'notruesize');
Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
Use IMSHOW(...,'InitialMagnification','fit') instead.
> In imshow>preParseInputs at 293
In imshow at 149
>>
F=fftshift(abs(fft2(f)));
>>
>> imshow(F,[-1 5], 'notruesize');
Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
Use IMSHOW(...,'InitialMagnification','fit') instead.
> In imshow>preParseInputs at 293
In imshow at 149
>>
>> f=zeros(1000,1000);
>> f(350:640,475:524)=1;
>> subplot(221)
>> imshow(f,'notruesize');
Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
Use IMSHOW(...,'InitialMagnification','fit') instead.
> In imshow>preParseInputs at 293
In imshow at 149
>> subplot(221)
>> imshow(f,'notruesize');
Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
Use IMSHOW(...,'InitialMagnification','fit') instead.
> In imshow>preParseInputs at 293
In imshow at 149
>> title('原始图片');
>> subplot(222)
>> F=fftshift(abs(fft2(f)));
>> imshow(F,[-1 5],'notruesize');
Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
Use IMSHOW(...,'InitialMagnification','fit') instead.
> In imshow>preParseInputs at 293
In imshow at 149
>> title('原始图像的傅里叶变换频谱');
>> subplot(223)
>> f=zeros(1000,1000);
>> f(350:649,800:849)=1;
>> imshow(f,'notruesize');
Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
Use IMSHOW(...,'InitialMagnification','fit') instead.
> In imshow>preParseInputs at 293
In imshow at 149
>> title('向x轴方向移动后的图像');
>> subplot(224)
>> F=fftshift(abs(fft2(f)));
>> imshow(F,[-1 5] ,'notruesize');
Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
Use IMSHOW(...,'InitialMagnification','fit') instead.
> In imshow>preParseInputs at 293
In imshow at 149
>> title('向x轴方向移动后的傅里叶变换频谱');
>>