image = | unrollRingImg (inImg,inCenter2d,inRadius,inRingHalfThickness,inOptOutSizeX) |
image = | unrollRingImg (inImg,inCenter2d,inRadius,inRingHalfThickness,inOptTheta0,inOptInterpolationPolicy,inOptOutSizeX) |
algorithm allowing to unroll surface of a ring
This algorithm allows to unroll surface of a ring into an image to a rectangular image area.
Given an input image
, and the following information :
: center for considered ring (x and y coordinates)
: radius for considered ring
: half thickness for considered ring
: an optional starting angle for unrolling process (with null default value)
: an optional interpolation policy used during unrolling process (see ipsdk::imaproc::attr::eInterpolationPolicy for more informations)
algorithm will compute the unrolled surface of considered ring with respect to following figure :
Output image can be automatically created, in this case, user must setup
parameter.
Here is an example of application of UnrollRingImg algorithm on a 2d image :
Here is an other example of application of UnrollRingImg algorithm on a 2d image :
This algorithm can also be used on 3d cylinder oriented with respect to z axis :
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLGeometricTransform as gtrans
Code Example
inImg = PyIPSDK.loadTiffImageFile(inputImg2dPath1)
center1 = PyIPSDK.createCoords2d(210, 203);
radius1 = 125;
ringHalfThickness1 = 50;
outSizeX1 = 1000;
outImg2d1 = gtrans.unrollRingImg(inImg, center1, radius1, ringHalfThickness1, outSizeX1);
inImg3d = PyIPSDK.loadTiffImageFile(inputImg3dPath1);
center2 = PyIPSDK.createCoords2d(52, 40);
radius2 = 15;
ringHalfThickness2 = 10;
outSizeX2 = 100;
outImg3d1 = gtrans.unrollRingImg(inImg3d, center2, radius2, ringHalfThickness2, outSizeX2);
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLGeometricTransform/Processor/UnrollRingImg/UnrollRingImg.h>
Code Example
const ipReal64 radius1 = 125;
const ipUInt32 ringHalfThickness1 = 50;
const ipUInt32 outSizeX1 = 1000;
ImagePtr pOutImg2d1 = unrollRingImg(pInImg, pCenter1, radius1, ringHalfThickness1, outSizeX1);
const ipReal64 radius2 = 15;
const ipUInt32 ringHalfThickness2 = 10;
const ipUInt32 outSizeX2 = 100;
ImagePtr pOutImg3d1 = unrollRingImg(pInImg3d, pCenter2, radius2, ringHalfThickness2, outSizeX2);