rft_generic ( Image : ImageFFT : Direction, Norm, ResultType, Width : )

Compute the real-valued fast Fourier transform of an image.

rft_generic computes the fast Fourier transform of the input image Image. In contrast to fft_generic, fft_image, and fft_image_inv, the fact that the input image in the forward transform is a real-valued image (i.e., not a complex image) is used. In this case, the complex output image has a redundancy. The values in the right half of the image are the complex conjugates of the corresponding values in the left half of the image. Consequently, runtime and memory can be saved by only computing and storing the left half of the complex image.

The parameter ResultType can be used to specify the result image type of the reverse transform (Direction = 'from_freq'). In the forward transform (Direction = 'to_freq'), ResultType must be set to 'complex'.

The parameter direction determines whether the transform should be performed to the frequency domain or back into the spatial domain. For Direction = 'to_freq' the input image must have a real-valued type, i.e., a complex image may not be used as input. All image types that can be converted into an image of type real are supported. In this case, the output is a complex image of dimension (w/2+1)*h, where w and h are the width and height of the input image. In this mode, the exponent -1 is used in the transform (see fft_generic). For Direction = 'from_freq', the input image must be complex. In this case, the size of the input image is insufficient to determine the size of the output image. This must be done by setting Width to a valid value, i.e., to 2*w-2 or 2*w-1, where w is the width of the complex image. In this mode, the exponent 1 is used in the transform.

The normalizing factor can be set with Norm, and can take on the values 'none', 'sqrt' and 'n'. The user must ensure the consistent use of the parameters. This means that the normalizing factors used for the forward and backward transform must yield w*h when multiplied.


Attention

The filtering is always done on the entire image, i.e., the region of the image is ignored.


Parameters

Image (input_object)
image(-array) -> object : byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex
Input image.

ImageFFT (output_object)
image(-array) -> object : byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex
Fourier-transformed image.

Direction (input_control)
string -> string
Calculate forward or reverse transform.
Default value: 'to_freq'
List of values: 'to_freq', 'from_freq'

Norm (input_control)
string -> string
Normalizing factor of the transform.
Default value: 'sqrt'
List of values: 'none', 'sqrt', 'n'

ResultType (input_control)
string -> string
Image type of the output image.
Default value: 'complex'
List of values: 'complex', 'byte', 'int1', 'int2', 'uint2', 'int4', 'real', 'direction', 'cyclic'

Width (input_control)
integer -> integer
Width of the image for which the runtime should be optimized.
Default value: 512
Suggested values: 128, 160, 192, 256, 320, 384, 512, 640, 768, 1024, 2048


Result

rft_generic returns 2 (H_MSG_TRUE) if all parameters are correct. If the input is empty the behavior can be set via set_system(::'no_object_result',<Result>:). If necessary, an exception handling is raised.


Parallelization Information

rft_generic is reentrant and automatically parallelized (on tuple level).


Possible Predecessors

optimize_rft_speed, read_fft_optimization_data


Possible Successors

convol_fft, convert_image_type, power_byte, power_real, power_ln, phase_deg, phase_rad


Alternatives

fft_generic, fft_image, fft_image_inv


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH