ImageDev

ComplexFft

Computes the Fast Fourier Transform of an image.

Access to parameter description

For an introduction: see section Frequency Domain.

This algorithm computes the FFT of an image. The result is two floating point images, respectively: the real and imaginary parts of the transform.

Remarks See also

Function Syntax

This function returns a ComplexFftOutput structure containing the outputRealImage and outputImaginaryImage output parameters.
// Output structure.
struct ComplexFftOutput
{
    std::shared_ptr< iolink::ImageView > outputRealImage;
    std::shared_ptr< iolink::ImageView > outputImaginaryImage;
};

// Function prototype.
ComplexFftOutput
complexFft( std::shared_ptr< iolink::ImageView > inputImage,
            std::shared_ptr< iolink::ImageView > outputRealImage = NULL,
            std::shared_ptr< iolink::ImageView > outputImaginaryImage = NULL );
This function returns a tuple containing the output_real_image and output_imaginary_image output parameters.
// Function prototype.
complex_fft( input_image, output_real_image = None, output_imaginary_image = None )
This function returns a ComplexFftOutput structure containing the outputRealImage and outputImaginaryImage output parameters.
/// Output structure of the ComplexFft function.
public struct ComplexFftOutput
{
    public IOLink.ImageView outputRealImage;
    public IOLink.ImageView outputImaginaryImage;
};

// Function prototype.
public static ComplexFftOutput
ComplexFft( IOLink.ImageView inputImage,
            IOLink.ImageView outputRealImage = null,
            IOLink.ImageView outputImaginaryImage = null );

Class Syntax

Parameters

Class Name ComplexFft

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" );

ComplexFft complexFftAlgo;
complexFftAlgo.setInputImage( polystyrene_float );
complexFftAlgo.execute();

std::cout << "outputRealImage:" << complexFftAlgo.outputRealImage()->toString();
std::cout << "outputImaginaryImage:" << complexFftAlgo.outputImaginaryImage()->toString();
polystyrene_float = imagedev.read_vip_image(imagedev_data.get_image_path("polystyrene_float.vip"))

complex_fft_algo = imagedev.ComplexFft()
complex_fft_algo.input_image = polystyrene_float
complex_fft_algo.execute()

print( "output_real_image:", str( complex_fft_algo.output_real_image ) )
print( "output_imaginary_image:", str( complex_fft_algo.output_imaginary_image ) )
ImageView polystyrene_float = Data.ReadVipImage( @"Data/images/polystyrene_float.vip" );

ComplexFft complexFftAlgo = new ComplexFft
{
    inputImage = polystyrene_float
};
complexFftAlgo.Execute();

Console.WriteLine( "outputRealImage:" + complexFftAlgo.outputRealImage.ToString() );
Console.WriteLine( "outputImaginaryImage:" + complexFftAlgo.outputImaginaryImage.ToString() );

Function Examples

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

auto result = complexFft( polystyrene_float );

std::cout << "outputRealImage:" << result.outputRealImage->toString();
std::cout << "outputImaginaryImage:" << result.outputImaginaryImage->toString();
polystyrene_float = imagedev.read_vip_image(imagedev_data.get_image_path("polystyrene_float.vip"))

result_output_real_image, result_output_imaginary_image = imagedev.complex_fft( polystyrene_float )

print( "output_real_image:", str( result_output_real_image ) )
print( "output_imaginary_image:", str( result_output_imaginary_image ) )
ImageView polystyrene_float = Data.ReadVipImage( @"Data/images/polystyrene_float.vip" );

Processing.ComplexFftOutput result = Processing.ComplexFft( polystyrene_float );

Console.WriteLine( "outputRealImage:" + result.outputRealImage.ToString() );
Console.WriteLine( "outputImaginaryImage:" + result.outputImaginaryImage.ToString() );