Foundation (CVFoundation.dll) 15.0
Fast Fourier Transform Functions

Enumerations

enum  TFFTNormalization { FFT_NORM_FWD = 1 , FFT_NORM_INV = 2 , FFT_NORM_SQRTN = 4 , FFT_NORM_NONE = 8 }
 Fourier Transform normalization. More...
 
enum  TFFTWindowing { FFT_WINDOW_NONE = 0 , FFT_WINDOW_HAMMING = 1 , FFT_WINDOW_BARTLETT = 2 , FFT_WINDOW_SEPARATEBARTLETT = 3 }
 Fourier Transform windowing. More...
 

Functions

cvbres_t CreateFFTBandPassFilter (FFTImage ImageIn, float center1, float center2, float width, FFTImage &ImgOut)
 Generates a band pass filter in Fourier space. More...
 
cvbres_t CreateFFTBandStopFilter (FFTImage ImageIn, float center1, float center2, float width, FFTImage &ImgOut)
 Generates a band stop filter in Fourier space. More...
 
cvbres_t CreateFFTHighPassFilter (FFTImage ImageIn, float center, float width, FFTImage &ImgOut)
 Generates a high pass filter in Fourier space. More...
 
cvbres_t CreateFFTLowPassFilter (FFTImage ImageIn, float center, float width, FFTImage &ImgOut)
 Generates a low pass filter in Fourier space. More...
 
cvbres_t CVBImageToFFTImage (IMG ImageIn, FFTImage &ImgOut)
 The CVBImageToFFTImage function converts a CVB image with 2 planes to a FFTImage object. Plane 0 has to represent the real part of the image and plane 1 the imaginary part of the image. More...
 
cvbres_t FFTFwd (IMG ImageIn, cvbdim_t left, cvbdim_t top, cvbdim_t right, cvbdim_t bottom, cvbdim_t Index, TFFTNormalization normalization, TFFTWindowing windowing, FFTImage &ImgOut)
 The FFTFwd function applies a forward Fast Fourier Transform to the input image (ImageIn). More...
 
cvbres_t FFTImageToCVBImage (FFTImage ImageIn, IMG &ImgOut)
 The FFTImageToCVBImage function converts a FFTImage to a CVBImage with two planes so that the Image in Fourier space can be used as CVB Image. Plane 0 is the real part of the image and plane 1 is the imaginary part of the image. More...
 
cvbres_t FFTImageToMagnitude (FFTImage ImageIn, IMG &ImgOut)
 The FFTImageToMagnitude function calculates the magnitude of elements of the source FFTImage (ImageIn). and returns a CVB Image (ImgOut) with magnitude values as float image. More...
 
cvbres_t FFTImageToPhase (FFTImage ImageIn, IMG &ImgOut)
 The FFTImageToPhase function calculates the phase of elements of the source FFTImage (ImageIn). and returns a CVB Image (ImgOut) with phase values as float image. More...
 
cvbres_t FFTInv (FFTImage ImageIn, TFFTNormalization normalization, IMG &ImgOut)
 The FFTInv function applies a inverse Fast Fourier Transform to the input FFTImage (ImageIn). It needs a FFTImage as ImageIn and returns a CVB Image (ImgOut). More...
 
cvbres_t MultiplyConjFFTImages (FFTImage Image1In, FFTImage Image2In, FFTImage &ImgOut)
 The MultiplyConjFFTImages function multiplies Image1In with the
complex conjugate image of Image2In and returns the result as FFTImage (ImgOut) in Fourier space. If you need to access the image data of the output image in Fourier space you have to convert the FFTImage to a CVB Image in Fourier space with /ref FFTImageToCVBImage. To reconvert the image to a FFTImage use /ref CVBImageToFFTImage. More...
 
cvbres_t MultiplyFFTImages (FFTImage Image1In, FFTImage Image2In, FFTImage &ImgOut)
 The MultiplyFFTImages function multiplies the two source images (Image1In) and (Image2In). and returns the result as FFTImage Object (ImgOut). If you need to access the image data of the output image in Fourier space you have to convert the FFTImage to a CVB Image in Fourier space with /ref FFTImageToCVBImage. To reconvert the image to a FFTImage use /ref CVBImageToFFTImage. More...
 

Detailed Description

Author
SKi
Version
1.0.0.0
Since
1.0.0.0 Finished implementation. (SKi, 01.02.2011)

Enumeration Type Documentation

◆ TFFTNormalization

Fourier Transform normalization.

The results of computing the Fourier transform can be normalized by specifying the appropriate value of TFFTNormalization. This parameter sets up a pair of matched normalization factors to be used in forward and inverse transforms.

Enumerator
FFT_NORM_FWD 

1/XY is used as Normalization in a Forward Transformation

FFT_NORM_INV 

1/XY is used as Normalization in a Inverse Transformation

FFT_NORM_SQRTN 

1/sqrt(XY) is used in Forward and Inverse Transformation

FFT_NORM_NONE 

No Normalization is used.

◆ TFFTWindowing

Fourier Transform windowing.

A window is a mathematical function by which pixel values are multiplied to prepare an image for the subsequent analysis. This procedure is often called 'windowing'. A suitable window function approaches zero towards the edges of the image avoiding strong distortions of spectral densities in the Fourier domain.

Enumerator
FFT_WINDOW_NONE 

No Windowing function is used.

FFT_WINDOW_HAMMING 

Hamming Windowing function is used.

FFT_WINDOW_BARTLETT 

Bartlett Windowing function is used.

FFT_WINDOW_SEPARATEBARTLETT 

Bartlett Windowing function applies the window function successively to the rows and then to the columns of the image.

Function Documentation

◆ CreateFFTBandPassFilter()

cvbres_t CreateFFTBandPassFilter ( FFTImage  ImageIn,
float  center1,
float  center2,
float  width,
FFTImage &  ImgOut 
)

Generates a band pass filter in Fourier space.

The filter image can be used with MultiplyFFTImages or MultiplyConjFFTImages to Filter an image in Fourier space.

To access the Fourier data convert the FFTImage to a CVB Image using FFTImageToCVBImage.

Attention
Release ImgOut with ReleaseObject when it is no longer needed.
Parameters
[in]ImageInInput FFTImage object (necessary to determine the actual size of the filter; if the size of the image to be filtered changes, the Fourier representation of the filter will need to be recalculated).
[in]center1Lower cutoff position of the filter relative to the range of frequencies (range [0...1]).
[in]center2Upper cutoff position of the filter relative to the range of frequencies (range [0...1]).
[in]widthWidth of the filter cutoff region (range [0...1]). Higher values may help reduce ring artifacts. When uncertain, use 0.1.
[out]ImgOutFourier representation of the low pass filter defined by thecenter and width parameter.
Returns
A value >= 0 indicates success. In case of an error, one of the values from CVCError.h is returned.

◆ CreateFFTBandStopFilter()

cvbres_t CreateFFTBandStopFilter ( FFTImage  ImageIn,
float  center1,
float  center2,
float  width,
FFTImage &  ImgOut 
)

Generates a band stop filter in Fourier space.

The filter image can be used with MultiplyFFTImages or MultiplyConjFFTImages to Filter an image in Fourier space.

To access the Fourier data convert the FFTImage to a CVB Image using FFTImageToCVBImage.

Attention
Release ImgOut with ReleaseObject when it is no longer needed.
Parameters
[in]ImageInInput FFTImage object (necessary to determine the actual size of the filter; if the size of the image to be filtered changes, the Fourier representation of the filter will need to be recalculated).
[in]center1Lower cutoff position of the filter relative to the range of frequencies (range [0...1]).
[in]center2Upper cutoff position of the filter relative to the range of frequencies (range [0...1]).
[in]widthWidth of the filter cutoff region (range [0...1]). Higher values may help reduce ring artifacts. When uncertain, use 0.1.
[out]ImgOutFourier representation of the low pass filter defined by thecenter and width parameter.
Returns
A value >= 0 indicates success. In case of an error, one of the values from CVCError.h is returned.

◆ CreateFFTHighPassFilter()

cvbres_t CreateFFTHighPassFilter ( FFTImage  ImageIn,
float  center,
float  width,
FFTImage &  ImgOut 
)

Generates a high pass filter in Fourier space.

The filter image can be used with MultiplyFFTImages or MultiplyConjFFTImages to Filter an image in Fourier space.

To access the Fourier data convert the FFTImage to a CVB Image using FFTImageToCVBImage.

Attention
Release ImgOut with ReleaseObject when it is no longer needed.
Parameters
[in]ImageInInput FFTImage object (necessary to determine the actual size of the filter; if the size of the image to be filtered changes, the Fourier representation of the filter will need to be recalculated).
[in]centerCutoff position of the filter relative to the range of frequencies (range [0...1]).
[in]widthWidth of the filter cutoff region (range [0...1]). Higher values may help reduce ring artifacts. When uncertain, use 0.1.
[out]ImgOutFourier representation of the low pass filter defined by thecenter and width parameter.
Returns
A value >= 0 indicates success. In case of an error, one of the values from CVCError.h is returned.

◆ CreateFFTLowPassFilter()

cvbres_t CreateFFTLowPassFilter ( FFTImage  ImageIn,
float  center,
float  width,
FFTImage &  ImgOut 
)

Generates a low pass filter in Fourier space.

The filter image can be used with MultiplyFFTImages or MultiplyConjFFTImages to Filter an image in Fourier space.

To access the Fourier data convert the FFTImage to a CVB Image using FFTImageToCVBImage.

Attention
Release ImgOut with ReleaseObject when it is no longer needed.
Parameters
[in]ImageInInput FFTImage object (necessary to determine the actual size of the filter; if the size of the image to be filtered changes, the Fourier representation of the filter will need to be recalculated).
[in]centerCutoff position of the filter relative to the range of frequencies (range [0...1]).
[in]widthWidth of the filter cutoff region (range [0...1]). Higher values may help reduce ring artifacts. When uncertain, use 0.1.
[out]ImgOutFourier representation of the low pass filter defined by thecenter and width parameter.
Returns
A value >= 0 indicates success. In case of an error, one of the values from CVCError.h is returned.

◆ CVBImageToFFTImage()

cvbres_t CVBImageToFFTImage ( IMG  ImageIn,
FFTImage &  ImgOut 
)

The CVBImageToFFTImage function converts a CVB image with 2 planes to a FFTImage object. Plane 0 has to represent the real part of the image and plane 1 the imaginary part of the image.

Attention
Release the Output Image ImgOut with ReleaseObject when it is no longer needed to decrement the reference counter.
Parameters
[in]ImageInInput image with 2 planes in Fourier space
[out]ImgOutOutput FFTImage in Fourier space
Returns
A value >= 0 indicates success. In case of an error, one of the values from CVCError.h is returned.

◆ FFTFwd()

cvbres_t FFTFwd ( IMG  ImageIn,
cvbdim_t  left,
cvbdim_t  top,
cvbdim_t  right,
cvbdim_t  bottom,
cvbdim_t  Index,
TFFTNormalization  normalization,
TFFTWindowing  windowing,
FFTImage &  ImgOut 
)

The FFTFwd function applies a forward Fast Fourier Transform to the input image (ImageIn).

It returns a FFTImage Object which represents the ImageIn in Fourier space. The FFTImage uses a compressed representation that makes use of the hermitian symmetries present in the FFT of a real-valued input image. A consequence of this is that the FFTImage objects cannot be displayed directly - use FFTImageToMagnitude and FFTImageToPhase to get a comprehensible visual representation of the fourier transform results.

The FFTImage objects can, however, be fed directly to the multiplication functions MultiplyFFTImages and MultiplyConjFFTImages, which are of particular interest for building Fourier-based filters.

To get direct access to the Fourier representation of the image, use FFTImageToCVBImage and CVBImageToFFTImage.

Attention
The FFTImage object ImgOut should be released using ReleaseObject when it is no longer needed.
Parameters
[in]ImageInObject handle of the source image to be used.
[in]leftLeft edge of the area of interest.
[in]topTop edge of the area of interest.
[in]rightRight edge of the area of interest.
[in]bottomBottom edge of the area of interest.
[in]IndexPlane of the input image to undergo transformation
[in]normalizationNormalization to be used, taken from the TFFTNormalization enum. When uncertain use FFT_NORM_SQRTN.
[in]windowingWindowing to be used, taken from the TFFTWindowing enum.
[out]ImgOutCompressed Fourier space representation of the input image (ImageIn).
Returns
A value >= 0 indicates success. In case of an error, one of the values from CVCError.h is returned.
Examples:
CSharp - C# Foundation FFT Example Visual C++ - VC Foundation FFT Example Visual C++ - VC FFT Scaling Example

◆ FFTImageToCVBImage()

cvbres_t FFTImageToCVBImage ( FFTImage  ImageIn,
IMG ImgOut 
)

The FFTImageToCVBImage function converts a FFTImage to a CVBImage with two planes so that the Image in Fourier space can be used as CVB Image. Plane 0 is the real part of the image and plane 1 is the imaginary part of the image.

Attention
Release the Output Image ImgOut with ReleaseObject when it is no longer needed to decrement the reference counter.
Parameters
[in]ImageInFFTImage Object in Fourier space
[out]ImgOutOutput CVB Image in Fourier space
Returns
A value >= 0 indicates success. In case of an error, one of the values from CVCError.h is returned.

◆ FFTImageToMagnitude()

cvbres_t FFTImageToMagnitude ( FFTImage  ImageIn,
IMG ImgOut 
)

The FFTImageToMagnitude function calculates the magnitude of elements of the source FFTImage (ImageIn). and returns a CVB Image (ImgOut) with magnitude values as float image.

Attention
Release the Output Image ImgOut with ReleaseObject when it is no longer needed to decrement the reference counter.
Parameters
[in]ImageInFFTImage Object in Fourier space
[out]ImgOutObject handle of the float output image.
Returns
A value >= 0 indicates success. In case of an error, one of the values from CVCError.h is returned.

◆ FFTImageToPhase()

cvbres_t FFTImageToPhase ( FFTImage  ImageIn,
IMG ImgOut 
)

The FFTImageToPhase function calculates the phase of elements of the source FFTImage (ImageIn). and returns a CVB Image (ImgOut) with phase values as float image.

Attention
Release the Output Image ImgOut with ReleaseObject when it is no longer needed to decrement the reference counter.
Parameters
[in]ImageInFFTImage Object in Fourier space
[out]ImgOutObject handle of the float output image.
Returns
A value >= 0 indicates success. In case of an error, one of the values from CVCError.h is returned.

◆ FFTInv()

cvbres_t FFTInv ( FFTImage  ImageIn,
TFFTNormalization  normalization,
IMG ImgOut 
)

The FFTInv function applies a inverse Fast Fourier Transform to the input FFTImage (ImageIn). It needs a FFTImage as ImageIn and returns a CVB Image (ImgOut).

Attention
Release the Output Image ImgOut with ReleaseObject when it is no longer needed to decrement the reference counter.
Parameters
[in]ImageInFFTImage Object in Fourier space
[in]normalizationNormalization to be used, taken from the TFFTNormalization enum Use FFT_NORM_SQRTN as default value
[out]ImgOutObject handle of the output image.
Returns
A value >= 0 indicates success. In case of an error, one of the values from CVCError.h is returned.
Examples:
CSharp - C# Foundation FFT Example Visual C++ - VC Foundation FFT Example Visual C++ - VC FFT Scaling Example

◆ MultiplyConjFFTImages()

cvbres_t MultiplyConjFFTImages ( FFTImage  Image1In,
FFTImage  Image2In,
FFTImage &  ImgOut 
)

The MultiplyConjFFTImages function multiplies Image1In with the
complex conjugate image of Image2In and returns the result as FFTImage (ImgOut) in Fourier space. If you need to access the image data of the output image in Fourier space you have to convert the FFTImage to a CVB Image in Fourier space with /ref FFTImageToCVBImage. To reconvert the image to a FFTImage use /ref CVBImageToFFTImage.

Attention
Release the Output Image ImgOut with ReleaseObject when it is no longer needed to decrement the reference counter.
Parameters
[in]Image1InFirst FFTImage Object in Fourier space
[in]Image2InSecond FFTImage Object in Fourier space
[out]ImgOutOutput Image as FFTImage Object Can be Converted to a CVBImage with the function /ref FFTImageToCVBImage
Returns
A value >= 0 indicates success. In case of an error, one of the values from CVCError.h is returned.

◆ MultiplyFFTImages()

cvbres_t MultiplyFFTImages ( FFTImage  Image1In,
FFTImage  Image2In,
FFTImage &  ImgOut 
)

The MultiplyFFTImages function multiplies the two source images (Image1In) and (Image2In). and returns the result as FFTImage Object (ImgOut). If you need to access the image data of the output image in Fourier space you have to convert the FFTImage to a CVB Image in Fourier space with /ref FFTImageToCVBImage. To reconvert the image to a FFTImage use /ref CVBImageToFFTImage.

Attention
Release the Output Image ImgOut with ReleaseObject when it is no longer needed to decrement the reference counter.
Parameters
[in]Image1InFirst FFTImage Object in Fourier space
[in]Image2InSecond FFTImage Object in Fourier space
[out]ImgOutOutput Image as FFTImage Object Can be Converted to a CVBImage with the function /ref FFTImageToCVBImage
Returns
A value >= 0 indicates success. In case of an error, one of the values from CVCError.h is returned.