PolarToCart

Converts an image in the polar coordinate form to Cartesian coordinate form.

Syntax

IppStatus ippiPolarToCart_<mod>(const Ipp32f* pSrcMagn, const Ipp32f* pSrcPhase, int srcStep, IppiSize roiSize, Ipp32fc* pDst, int dstStep);

Supported values for mod:

32fc_C1R

32fc_C3R

IppStatus ippiPolarToCart_<mod>(const Ipp<sourceDatatype>* pSrcMagn, const Ipp<sourceDatatype>* pSrcPhase, int srcStep, int phaseFixedPoint, IppiSize roiSize, Ipp<dstDatatype>* pDst, int dstStep);

Supported values for mod:

16sc_C1R

16sc_C3R

32sc_C1R

32sc_C3R

Parameters

pSrcMagn

Pointer to the buffer containing magnitudes of the source image.

pSrcPhase

Pointer to the buffer containing phase values of the source image.

srcStep

Distance in bytes between starts of consecutive lines in the source buffers.

phaseFixedPoint

Specified the position of the decimal fixed point for the phase.

roiSize

Size of the source and destination image ROI.

pDst

Pointer to the destination image ROI.

dstStep

Distance in bytes between starts of consecutive lines in the destination image buffer.

Description

The function ippiPolarToCart is declared in the ippi.h file. It operates with ROI (see Regions of Interest in Intel IPP).

This function converts the polar coordinate of the source image stored in the arrays of magnitudes pSrcMagn and phase values pSrcPhase to the destination image pDst in complex-data format (in Cartesian coordinate form).

Example “Using the Function ippiPolarToCart” shows how to use the function ippiPolarToCart_32fc_C1R.

Return Values

ippStsNoErr

Indicates no error. Any other value indicates an error or a warning.

ippStsNullPtrErr

Indicates an error condition if one of the specified pointers is NULL.

ippStsStepErr

Indicates an error condition if srcStep or dstStep value is zero or negative.

ippStsSizeErr

Indicates an error condition if srcSize has a field with value less than 1.

Using the Function ippiPolarToCart

void func_polartocart()
{
    Ipp32f pSrcMagn[2*2] = {1.0, 0.0, 2.1, 3.2};
		
    Ipp32f pSrcPhase[2*2] = {0.0, 2.0, 1.6,-1.0};
    Ipp32fc pDst[2*2] = {0};
    int srcStep = 2*sizeof(Ipp32f);
    int dstStep = 2*sizeof(Ipp32fc);
    IppiSize roiSize = {2, 2};
 
    ippiPolarToCart_32fc_C1R(pSrcMagn, pSrcPhase, srcStep, roiSize, pDst, dstStep);
}
 
Result: pDst - > (1.0, 0.0)  (0.0, 0.0)  (-0.1, 2.1) (1.7, -2.7)
 

Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.