IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

Algorithm allowing to convert an image to a given type. More...

IPSDKIPLUTILITY_API image::ImagePtr ipsdk::imaproc::util::convertImg (const image::ImageConstPtr &pInImg, const image::eImageBufferType &inConvertImageBufferType)
 wrapper function for image conversion algorithm More...
 
IPSDKIPLUTILITY_API void ipsdk::imaproc::util::convertImg (const image::ImageConstPtr &pInImg, const image::ImagePtr &pOutImg)
 wrapper function for image conversion algorithm More...
 

Detailed Description

Algorithm allowing to convert an image to a given type.

This algorithm allows to convert an image.
Output image size is the same as input.
On output image value are given by :

\[ OutImg[i] = cast<OutType>(InImg[i]) \]

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg [Input] image for processing operation X
ipsdk::imaproc::attr::InConvertImageBufferType Input image buffer type parameter for image type convertion operation. X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation ipsdk::imaproc::duplicateInOut (_pOutImg, _pInImg, _pInConvertImageBufferType)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInImg,_pOutImg) && 
ipsdk::imaproc::bufferType (_pOutImg,_pInConvertImageBufferType)

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLUtility as util

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# image convertion
outImg = util.convertImg(inImg, PyIPSDK.eImageBufferType.eIBT_UInt16)

Example of C++ code :

Example informations

Associated library

IPSDKIPLUtility

Header file

Code Example

// opening input image
ImageGeometryPtr pInputImageGeometry = geometry2d(inputImageBufferType, sizeX, sizeY);
ImagePtr pInImg = loadRawImageFile(inputImgPath, *pInputImageGeometry);
// conversion of image
ImagePtr pOutImg = convertImg(pInImg, outputImageBufferType);
See also
ConvertImgLvl1
ConvertImgLvl2
ConvertImgLvl3

Function Documentation

◆ convertImg() [1/2]

IPSDKIPLUTILITY_API image::ImagePtr ipsdk::imaproc::util::convertImg ( const image::ImageConstPtr pInImg,
const image::eImageBufferType inConvertImageBufferType 
)

wrapper function for image conversion algorithm

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ convertImg() [2/2]

IPSDKIPLUTILITY_API void ipsdk::imaproc::util::convertImg ( const image::ImageConstPtr pInImg,
const image::ImagePtr pOutImg 
)

wrapper function for image conversion algorithm

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure