IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Ring unrolling algorithmSee full documentation
imageunrollRingImg (inImg,inCenter2d,inRadius,inRingHalfThickness,inOptOutSizeX)
imageunrollRingImg (inImg,inCenter2d,inRadius,inRingHalfThickness,inOptTheta0,inOptInterpolationPolicy,inOptOutSizeX)

Detailed Description

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 $InImg$, and the following information :

algorithm will compute the unrolled surface of considered ring with respect to following figure :

unrollRingImg1.png

Output image can be automatically created, in this case, user must setup $InOptOutSizeX$ parameter.

Here is an example of application of UnrollRingImg algorithm on a 2d image :

unrollRingImg2.png

Here is an other example of application of UnrollRingImg algorithm on a 2d image :

unrollRingImg3.png

This algorithm can also be used on 3d cylinder oriented with respect to z axis :

unrollRingImg3d1.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLGeometricTransform as gtrans

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImg2dPath1)
# process ring unrolling in 2d case
center1 = PyIPSDK.createCoords2d(210, 203);
radius1 = 125;
ringHalfThickness1 = 50;
outSizeX1 = 1000;
outImg2d1 = gtrans.unrollRingImg(inImg, center1, radius1, ringHalfThickness1, outSizeX1);
# opening input 3d image
inImg3d = PyIPSDK.loadTiffImageFile(inputImg3dPath1);
# process ring unrolling in 3d case
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

// opening input 2d image
ImagePtr pInImg = loadTiffImageFile(inputImg2dPath1);
// process ring unrolling in 2d case
Coords2dPtr pCenter1 = createCoords2d(210, 203);
const ipReal64 radius1 = 125;
const ipUInt32 ringHalfThickness1 = 50;
const ipUInt32 outSizeX1 = 1000;
ImagePtr pOutImg2d1 = unrollRingImg(pInImg, pCenter1, radius1, ringHalfThickness1, outSizeX1);
// opening input 3d image
ImagePtr pInImg3d = loadTiffImageFile(inputImg3dPath1);
// process ring unrolling in 3d case
Coords2dPtr pCenter2 = createCoords2d(52, 40);
const ipReal64 radius2 = 15;
const ipUInt32 ringHalfThickness2 = 10;
const ipUInt32 outSizeX2 = 100;
ImagePtr pOutImg3d1 = unrollRingImg(pInImg3d, pCenter2, radius2, ringHalfThickness2, outSizeX2);