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 outputRealImage and outputImaginaryImage.
// Output structure of the complexFft function.
struct ComplexFftOutput
{
    /// 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
ComplexFftOutput complexFft( std::shared_ptr< iolink::ImageView > inputImage, std::shared_ptr< iolink::ImageView > outputRealImage = nullptr, std::shared_ptr< iolink::ImageView > outputImaginaryImage = nullptr );
This function returns a tuple containing output_real_image and output_imaginary_image.
// Function prototype.
complex_fft(input_image: idt.ImageType,
            output_real_image: idt.ImageType = None,
            output_imaginary_image: idt.ImageType = None) -> Tuple[idt.ImageType, idt.ImageType]
This function returns a ComplexFftOutput structure containing outputRealImage and outputImaginaryImage.
/// Output structure of the ComplexFft function.
public struct ComplexFftOutput
{
    /// 
    /// The output real part image. Its dimensions are forced to the same values as the input. Its data type is forced to floating point.
    /// 
    public 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.
    /// 
    public IOLink.ImageView outputImaginaryImage;
};

// Function prototype.
public static ComplexFftOutput
ComplexFft( IOLink.ImageView inputImage,
            IOLink.ImageView outputRealImage = null,
            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
Parameter Name Description Type Supported Values Default Value
input
input_image
The input image. image Binary, Label, Grayscale or Multispectral None
output
output_real_image
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 None
output
output_imaginary_image
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 None
Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral null
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 null
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 null

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