Functions

Fourier Transform Operations
[Image Processing]

Collaboration diagram for Fourier Transform Operations:

Functions

void imProcessFFT (const imImage *src_image, imImage *dst_image)
void imProcessIFFT (const imImage *src_image, imImage *dst_image)
void imProcessFFTraw (imImage *image, int inverse, int center, int normalize)
void imProcessSwapQuadrants (imImage *image, int center2origin)

Detailed Description

All Fourier transforms use FFTW 3.x library.
The pre-compiled binaries depend on an external library. For Windows the FFTW DLLs are included in the package. For Linux you must use the libfftw3 included with your sysytem.
FFTW Copyright Matteo Frigo, Steven G. Johnson and the MIT.
http://www.fftw.org
See "fftw.h"
Must link with "im_fftw3" library.
IMPORTANT: The FFTW lib has a GPL license. The license of the "im_fftw3" library is automatically the GPL. So you cannot use it for commercial applications without contacting the authors.
FFTW 3.x have float and double support.
See im_process_glo.h

Function Documentation

void imProcessFFT ( const imImage src_image,
imImage dst_image 
)

Forward FFT.
The result has its lowest frequency at the center of the image.
This is an unnormalized fft.
Images must be of the same size. Target image must be of type complex.

im.ProcessFFT(src_image: imImage, dst_image: imImage) [in Lua 5] 
im.ProcessFFTNew(image: imImage) -> new_image: imImage [in Lua 5] 
void imProcessIFFT ( const imImage src_image,
imImage dst_image 
)

Inverse FFT.
The image has its lowest frequency restored to the origin before the transform.
The result is normalized by (width*height).
Images must be of the same size and both must be of type complex.

im.ProcessIFFT(src_image: imImage, dst_image: imImage) [in Lua 5] 
im.ProcessIFFTNew(image: imImage) -> new_image: imImage [in Lua 5] 
void imProcessFFTraw ( imImage image,
int  inverse,
int  center,
int  normalize 
)

Raw in-place FFT (forward or inverse).
The lowest frequency can be centered after forward, or can be restored to the origin before inverse.
The result can be normalized after the transform by sqrt(w*h) [1] or by (w*h) [2], or left unnormalized [0].
Images must be of the same size and both must be of type complex.

im.ProcessFFTraw(image: imImage, inverse: number, center: number, normalize: number) [in Lua 5] 
void imProcessSwapQuadrants ( imImage image,
int  center2origin 
)

Auxiliary function for the raw FFT.
This is the function used internally to change the lowest frequency position in the image.
If the image size has even dimensions the flag "center2origin" is useless. But if it is odd, you must specify if its from center to origin (usually used before inverse) or from origin to center (usually used after forward).
Notice that this function is used for images in the the frequency domain.
Image type must be complex.

im.ProcessSwapQuadrants(image: imImage, center2origin: number) [in Lua 5]