xImg,yImg = | polarToCartesianImg (inRhoImg,inThetaImg) |
computation of the polar to cartesian coordinates transformation
This algorithm computes the polar to cartesian coordinates transformations of input images
and
:
and
For more informations report to Points and vectors 2d representation
- See also
- https://en.wikipedia.org/wiki/Polar_coordinate_system
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLArithmetic as arithm
Code Example
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
gxImg = PyIPSDK.createImage(PyIPSDK.eImageBufferType.eIBT_Real32,
inImg.getSizeX(), inImg.getSizeY())
gyImg = PyIPSDK.createImage(PyIPSDK.eImageBufferType.eIBT_Real32,
inImg.getSizeX(), inImg.getSizeY())
filter.gaussianGradient2dImg(inImg, 1.5, 1.5, PyIPSDK.createGaussianCoverage(0.997, 2), gxImg, gyImg)
rhoImg, thetaImg = arithm.cartesianToPolarImg(gxImg, gyImg)
outXImg, outYImg = arithm.polarToCartesianImg(rhoImg, thetaImg)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLArithmetic/Processor/PolarToCartesianImg/PolarToCartesianImg.h>
Code Example
pInImg->getSizeX(), pInImg->getSizeY());
MemoryImagePtr pGxImg(boost::make_shared<MemoryImage>());
pGxImg->init(*pGradientGeometry);
MemoryImagePtr pGyImg(boost::make_shared<MemoryImage>());
pGyImg->init(*pGradientGeometry);
CartesianImg cartesianData = polarToCartesianImg(polarData._pRhoImg, polarData._pThetaImg);
ImagePtr pOutXImg = cartesianData._pXImg;
ImagePtr pOutYImg = cartesianData._pYImg;