IM: Fourier Transform Operations

IM - An Imaging Tool

Fourier Transform Operations
[Image Processing]


Detailed Description

All Fourier transforms use FFTW library version 2.1.5.
Although there are newer versions, we build binaries only to version 2 because it is small and as fast as newer versions. Source code to use FFTW version 3 is available.
FFTW Copyright Matteo Frigo, Steven G. Johnson and the MIT.
http://www.fftw.org
See "fftw.h"
Must link with "im_fftw" library.
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.
See im_process_glo.h


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)

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. Destiny 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]