ImageDev

ComplexCenteredFft

Computes the centered Fast Fourier Transform of an image.

Access to parameter description

For an introduction: see section Frequency Domain.

This algorithm is used to visualize the modulus of the FFT centered in the middle of image rather than in the upper left corner. The image is centered by a translation in circular mode by a vector equal to half the diagonal of the image. In the following figure, to visualize the image, it is divided in four equal quadrants.

<b>Figure 1.</b> Results of a regular and centered FFT
Figure 1. Results of a regular and centered FFT

See also

Function Syntax

This function returns a ComplexCenteredFftOutput structure containing outputRealImage and outputImaginaryImage.
// Output structure of the complexCenteredFft function.
struct ComplexCenteredFftOutput
{
    /// The output real part image. Its dimensions are forced to the same values as the input. Its data type is forced to floating point.
    std::shared_ptr< iolink::ImageView > outputRealImage;
    /// The output imaginary part image. Its dimensions are forced to the same values as the input. Its data type is forced to floating point.
    std::shared_ptr< iolink::ImageView > outputImaginaryImage;
};

// Function prototype
ComplexCenteredFftOutput complexCenteredFft( std::shared_ptr< iolink::ImageView > inputImage, std::shared_ptr< iolink::ImageView > outputRealImage = NULL, std::shared_ptr< iolink::ImageView > outputImaginaryImage = NULL );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral nullptr
output
outputRealImage
The output real part image. Its dimensions are forced to the same values as the input. Its data type is forced to floating point. Image nullptr
output
outputImaginaryImage
The output imaginary part image. Its dimensions are forced to the same values as the input. Its data type is forced to floating point. Image nullptr

Object Examples

auto polystyrene_float = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_float.vip" );

ComplexCenteredFft complexCenteredFftAlgo;
complexCenteredFftAlgo.setInputImage( polystyrene_float );
complexCenteredFftAlgo.execute();

std::cout << "outputRealImage:" << complexCenteredFftAlgo.outputRealImage()->toString();
std::cout << "outputImaginaryImage:" << complexCenteredFftAlgo.outputImaginaryImage()->toString();

Function Examples

auto polystyrene_float = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_float.vip" );

auto result = complexCenteredFft( polystyrene_float );

std::cout << "outputRealImage:" << result.outputRealImage->toString();
std::cout << "outputImaginaryImage:" << result.outputImaginaryImage->toString();