Processing math: 100%
ImageDev

CartesianToPolar2d

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

Access to parameter description

For an introduction: see section Frequency Domain.

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

If I1 is the real part or X coordinate image and I2 the imaginary part or Y coordinate image, then: See also

Function Syntax

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

// Function prototype.
CartesianToPolar2dOutput
cartesianToPolar2d( std::shared_ptr< iolink::ImageView > inputRealImage,
                    std::shared_ptr< iolink::ImageView > inputImaginaryImage,
                    std::shared_ptr< iolink::ImageView > outputModulusImage = NULL,
                    std::shared_ptr< iolink::ImageView > outputPhaseImage = NULL );

Class Syntax

Parameters

Class Name CartesianToPolar2d

Parameter Name Description Type Supported Values Default Value
input
inputRealImage
The real part input image. It must be a floating point image. Image Grayscale or Multispectral nullptr
input
inputImaginaryImage
The imaginary part input image. This image must have same dimensions and data type as the real input image. Image Grayscale or Multispectral nullptr
output
outputModulusImage
The output modulus image. Its dimensions and type are forced to the same values as the input. Image nullptr
output
outputPhaseImage
The output phase 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" );

CartesianToPolar2d cartesianToPolar2dAlgo;
cartesianToPolar2dAlgo.setInputRealImage( polystyrene_float );
cartesianToPolar2dAlgo.setInputImaginaryImage( polystyrene_float );
cartesianToPolar2dAlgo.execute();

std::cout << "outputModulusImage:" << cartesianToPolar2dAlgo.outputModulusImage()->toString();
std::cout << "outputPhaseImage:" << cartesianToPolar2dAlgo.outputPhaseImage()->toString();

Function Examples

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

auto result = cartesianToPolar2d( polystyrene_float, polystyrene_float );

std::cout << "outputModulusImage:" << result.outputModulusImage->toString();
std::cout << "outputPhaseImage:" << result.outputPhaseImage->toString();