Skip to content

rft_genericRftGenericRftGenericrft_genericrft_generic🔗

Short description🔗

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

Signature🔗

rft_generic( image Image, out image ImageFFT, string Direction, string Norm, string ResultType, integer Width )void RftGeneric( const HObject& Image, HObject* ImageFFT, const HTuple& Direction, const HTuple& Norm, const HTuple& ResultType, const HTuple& Width )static void HOperatorSet.RftGeneric( HObject image, out HObject imageFFT, HTuple direction, HTuple norm, HTuple resultType, HTuple width )def rft_generic( image: HObject, direction: str, norm: str, result_type: str, width: int ) -> HObject

Herror rft_generic( const Hobject Image, Hobject* ImageFFT, const char* Direction, const char* Norm, const char* ResultType, const Hlong Width )

Herror T_rft_generic( const Hobject Image, Hobject* ImageFFT, const Htuple Direction, const Htuple Norm, const Htuple ResultType, const Htuple Width )

HImage HImage::RftGeneric( const HString& Direction, const HString& Norm, const HString& ResultType, Hlong Width ) const

HImage HImage::RftGeneric( const char* Direction, const char* Norm, const char* ResultType, Hlong Width ) const

HImage HImage::RftGeneric( const wchar_t* Direction, const wchar_t* Norm, const wchar_t* ResultType, Hlong Width ) const (Windows only)

HImage HImage.RftGeneric( string direction, string norm, string resultType, int width )

Description🔗

rft_genericRftGeneric computes the fast Fourier transform of the input image Imageimageimage. In contrast to fft_genericFftGeneric, fft_imageFftImage, and fft_image_invFftImageInv, 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 ResultTyperesultTyperesult_type can be used to specify the result image type of the reverse transform (Directiondirectiondirection \(=\) 'from_freq'"from_freq"). In the forward transform (Directiondirectiondirection \(=\) 'to_freq'"to_freq"), ResultTyperesultTyperesult_type must be set to 'complex'"complex".

The parameter direction determines whether the transform should be performed to the frequency domain or back into the spatial domain. For Directiondirectiondirection \(=\) 'to_freq'"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_genericFftGeneric). For Directiondirectiondirection \(=\) 'from_freq'"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 Widthwidthwidth to a valid value, i.e., to 2w-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 Normnormnorm, and can take on the values 'none'"none", 'sqrt'"sqrt" and 'n'"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 transformation is always performed for the entire image, i.e., the domain of the image is ignored.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on tuple level.

  • Automatically parallelized on channel level.

  • Automatically parallelized on internal data level.

Parameters🔗

Imageimageimage (input_object) (multichannel-)image(-array) → object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)HImage (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)Hobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)

Input image.

ImageFFTimageFFTimage_fft (output_object) image(-array) → object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)HImage (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)Hobject * (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)

Fourier-transformed image.

Directiondirectiondirection (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Calculate forward or reverse transform.

Default: 'to_freq'"to_freq"
List of values: 'from_freq', 'to_freq'"from_freq", "to_freq"

Normnormnorm (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Normalizing factor of the transform.

Default: 'sqrt'"sqrt"
List of values: 'n', 'none', 'sqrt'"n", "none", "sqrt"

ResultTyperesultTyperesult_type (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Image type of the output image.

Default: 'complex'"complex"
List of values: 'byte', 'complex', 'cyclic', 'direction', 'int1', 'int2', 'int4', 'real', 'uint2'"byte", "complex", "cyclic", "direction", "int1", "int2", "int4", "real", "uint2"

Widthwidthwidth (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Width of the image for which the runtime should be optimized.

Default: 512512
Suggested values: 128, 160, 192, 256, 320, 384, 512, 640, 768, 1024, 2048128, 160, 192, 256, 320, 384, 512, 640, 768, 1024, 2048

Result🔗

rft_genericRftGeneric 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 is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

optimize_rft_speedOptimizeRftSpeed, read_fft_optimization_dataReadFftOptimizationData

Possible successors

convol_fftConvolFft, correlation_fftCorrelationFft, phase_correlation_fftPhaseCorrelationFft, convert_image_typeConvertImageType, power_bytePowerByte, power_realPowerReal, power_lnPowerLn, phase_degPhaseDeg, phase_radPhaseRad

Alternatives

fft_genericFftGeneric, fft_imageFftImage, fft_image_invFftImageInv

Module🔗

Foundation