IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

computation of the square root of an image More...

IPSDKIPLARITHMETIC_API image::ImagePtr ipsdk::imaproc::arithm::sqrtImg (const image::ImageConstPtr &pInRealImg)
 wrapper functions for computation of the square root of an image, pixel by pixel More...
 
IPSDKIPLARITHMETIC_API void ipsdk::imaproc::arithm::sqrtImg (const image::ImageConstPtr &pInRealImg, const image::ImagePtr &pOutImg)
 wrapper functions for computation of the square root of an image, pixel by pixel More...
 

Detailed Description

computation of the square root of an image

On output image values are given by:

\[ OutImg[i] = \begin{cases} \sqrt{InImg[i]}, & \text{if }InImg[i] \geq 0 \\ 0, & \text{otherwise} \end{cases} \]

Input and output images must have same size. Input and output types must be real32.

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InRealImg [Input] image for processing operation (data contained in image buffer are reals) X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation ipsdk::imaproc::duplicateInOut (_pOutImg, _pInRealImg)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInRealImg,_pOutImg)

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLArithmetic as arithm

Code Example

# opening of input image
geometry = PyIPSDK.geometry2d(PyIPSDK.eImageBufferType.eIBT_Real32, 510, 509)
inImg = PyIPSDK.loadRawImageFile(inputImgPath, geometry)
# computation of image square root
outImg = arithm.sqrtImg(inImg)

Example of C++ code :

Example informations

Associated library

IPSDKIPLArithmetic

Header file

Code Example

// open input image
ImageGeometryPtr pImageGeometry = geometry2d(image::eImageBufferType::eIBT_Real32, sizeX, sizeY);
ImagePtr pInImg = loadRawImageFile(inputImgPath, *pImageGeometry);
// Sample with a generated output image
// ------------------------------------
// compute subtraction for input image
ImagePtr pAutoOutImg = sqrtImg(pInImg);
// Sample with a provided output image
// -----------------------------------
// create output image
boost::shared_ptr<MemoryImage> pOutImg(boost::make_shared<MemoryImage>());
pOutImg->init(*pImageGeometry);
// compute square root of input image
sqrtImg(pInImg, pOutImg);
See also
SqrtImgLvl1
SqrtImgLvl2
SqrtImgLvl3

Function Documentation

◆ sqrtImg() [1/2]

IPSDKIPLARITHMETIC_API image::ImagePtr ipsdk::imaproc::arithm::sqrtImg ( const image::ImageConstPtr pInRealImg)

wrapper functions for computation of the square root of an image, pixel by pixel

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ sqrtImg() [2/2]

IPSDKIPLARITHMETIC_API void ipsdk::imaproc::arithm::sqrtImg ( const image::ImageConstPtr pInRealImg,
const image::ImagePtr pOutImg 
)

wrapper functions for computation of the square root of an image, pixel by pixel

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure