IPSDK 0.2
IPSDK : Image Processing Software Development Kit
imagesqrtImg (inRealImg)

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.

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

Header file

#include <IPSDKIPL/IPSDKIPLArithmetic/Processor/SqrtImg/SqrtImg.h>

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);