To calculate and show the Fourier spectrum of an image in MATLAB:
main.m197 chars7 lines
To calculate the average value of the image using the Fourier spectrum, you can simply calculate the mean value of the Fourier transform:
main.m33 chars2 lines
Note that the Fourier spectrum is a complex number, so the absolute value is used to get the amplitude. Also, the log transform is often used to better visualize the spectrum.
gistlibby LogSnag