PROJECT 04-02

董高逸
2023-12-01

PROJECT 04-02

Fourier Spectrum and AverageValue

(a) Download Fig. 4.18(a) from the book web site andcompute its (centered) Fourier spectrum.

(b) Display the spectrum.

(c) Use your result in (a) to compute the average valueof the image.

 

f=imread('Fig4.11(a).jpg');
F=fft2(f);%使用函数fft2可计算傅立叶变换
 
[M,N]=size(f);
s=0;
s=sum(sum(abs(F(1:M,1:N))));
average_value_of_imagine=s/(M*N)
S=log(1+abs(F));%计算傅立叶幅度谱并做对数变换
figure;plot(S);title('二维图像显示幅度谱')%二维图像显示幅度谱
x=0:1:255;y=0:1:255;
[x,y]=meshgrid(x,y);
figure;mesh(S);title('三维图像显示幅度谱')%三维图像显示幅度谱
 
Q=angle(F);%计算傅立叶变换相位谱
figure;plot(Q);title('二维图像显示相位谱') %二维图像显示相位谱
 
x=0:1:255;y=0:1:255;
[x,y]=meshgrid(x,y);
figure;mesh(Q);title('三维图形显示相位谱')%三维图形显示相位谱


 类似资料: