Greetings,

I'm working on image classification and for that I want to use the spectral
slope as a feature for my classifier. For this I would prefer to calculate
this feature using R, so far I've read my image and converted it's RGB
representation into HSL. The spectral slope is computed over the Luminance
component, so at the moment what I have is a NxN matrix of Luminance values.

The following steps would be:
1- Calculating the FFT of the Luminance matrix.
2- Calculating the Power Spectra, which is computed as |FFT|^2.
3- Matching every Power Spectra value to its Spatial frequency and doing a
linear regression to compute the Spectral Slope.

My doubts start now: I know that there is a function called "fft" that
computes the fast fourier transform in R, but how does it exactly do it?
The formula for the DFT, for a NxN matrix is is F[u,v] = 1/N sum from {x=
0} to {N-1} sum from {y = 0} to {N-1} f(x,y) e^((-2*pi*j/N)*(xu+yv)),
however which coordinates origin does the R "fft" function assumes? Is it
possible to compute a centered "fft", meaning that the origin of our
coordinate system is in the center of our matrix?

Then, is there any R function to calculate the power spectra of a matrix of
data without having to compute the FFT first?

Thank you in Advance :)
Marc

	[[alternative HTML version deleted]]

