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 library.
The pre-compiled binaries for FFTW version 2.1.5 includes all the necessary files. The pre-compiled binaries for FFTW version 3.x depends on an external library, not provided. To build the code that uses FFTW version 3 you must define USE_FFTW3.
FFTW Copyright Matteo Frigo, Steven G. Johnson and the MIT.
http://www.fftw.org
See "fftw.h"
Must link with "im_fftw" library.
IMPORTANT: The FFTW lib has a GPL license. The license of the "im_fftw" library is automatically the GPL. So you cannot use it for commercial applications without contacting the authors.
FFTW 2.x can have float or double functions, not both.
FFTW 3.x can have both, but we use only one to keep the code compatible with version 2.
So by default the pre-compiled binaries are built with "float" support only.
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 float 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 float 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 float 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 float complex.

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