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('三维图形显示相位谱')%三维图形显示相位谱
本文探讨了傅立叶变换在图像处理领域的应用,包括计算图像的中心傅立叶谱、显示幅度谱与相位谱,并利用傅立叶谱计算图像的平均值。
863

被折叠的 条评论
为什么被折叠?



