rhoImg,thetaImg = | cartesianToPolarImg (inXImg,inYImg) |
computation of the cartesian to polar coordinates transformation
This algorithm computes the cartesian to polar coordinates transformations of input images
and
:
and
with
and ![$OutThetaImg[i] \in [-\pi, \pi]$](form_78.png)
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)
outRhoImg, outThetaImg = arithm.cartesianToPolarImg(gxImg, gyImg)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLArithmetic/Processor/CartesianToPolarImg/CartesianToPolarImg.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);
PolarImg polarData = cartesianToPolarImg(pGxImg, pGyImg);
ImagePtr pOutRhoImg = polarData._pRhoImg;
ImagePtr pOutThetaImg = polarData._pThetaImg;