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
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
- To compute the module and phase of the FFT, the CartesianToPolar2d algorithm can be used.
- The output images are centered in the upper left corner.
- The SwapQuadrants algorithm can be used to move low frequencies in the image center.
- The ComplexCenteredFft algorithm can be used to directly get a centered FFT.
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 = NULL, std::shared_ptr< iolink::ImageView > outputImaginaryImage = NULL );
This function returns a tuple containing output_real_image and output_imaginary_image.
// Function prototype. complex_fft( input_image, output_real_image = None, output_imaginary_image = None )
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
Class Name | ComplexFft |
---|
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
inputImage |
The input image. | Image | Binary, Label, Grayscale or Multispectral | nullptr | |
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 | ||
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() );