Processing math: 100%
ImageDev

PolarToCartesian2d

Transforms a pair of module and phase two-dimensional images into a pair of real and imaginary part images.

Access to parameter description

For an introduction: see section Frequency Domain.

This algorithm computes the polar-to-cartesian transformation or module/phase to the real/imaginary image transformation.

If I1 is the module image and I2 the phase image, then: See also

Function Syntax

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

// Function prototype
PolarToCartesian2dOutput polarToCartesian2d( std::shared_ptr< iolink::ImageView > inputModulusImage, std::shared_ptr< iolink::ImageView > inputPhaseImage, 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
inputModulusImage
The modulus input image. It must be a floating point image. Image Grayscale or Multispectral nullptr
input
inputPhaseImage
The phase input image. This image must have same dimensions and data type as the modulus input image. Image Grayscale or Multispectral nullptr
output
outputRealImage
The output real part image. Its dimensions and type are forced to the same values as the input. Image nullptr
output
outputImaginaryImage
The output imaginary part image. Its dimensions and type are forced to the same values as the input. Image nullptr

Object Examples

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

PolarToCartesian2d polarToCartesian2dAlgo;
polarToCartesian2dAlgo.setInputModulusImage( polystyrene_float );
polarToCartesian2dAlgo.setInputPhaseImage( polystyrene_float );
polarToCartesian2dAlgo.execute();

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

Function Examples

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

auto result = polarToCartesian2d( polystyrene_float, polystyrene_float );

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