IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

computation of the square of an image More...

IPSDKIPLARITHMETIC_API image::ImagePtr ipsdk::imaproc::arithm::squareImg (const image::ImageConstPtr &pInImg)
 wrapper function for Computation of the square of an image, pixel by pixel More...
 
IPSDKIPLARITHMETIC_API void ipsdk::imaproc::arithm::squareImg (const image::ImageConstPtr &pInImg, const image::ImagePtr &pOutImg)
 wrapper function for Computation of the square of an image, pixel by pixel More...
 

Detailed Description

computation of the square of an image

On output image values are given by:

\[ OutImg[i] = (InImg[i])^{2} \]

Input and output images must have same size

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg [Input] image for processing operation X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation promoteUnary (_pOutImg, _pInImg, ipsdk::imaproc::ePromoteUnaryType::ePUT_UpperUnsigned)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInImg,_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 the square of the input image
outImg = arithm.squareImg(inImg)

Example of C++ code :

Example informations

Associated library

IPSDKIPLArithmetic

Header file

Code Example

// open input image
ImageGeometryPtr pInputImageGeometry = geometry2d(inType, sizeX, sizeY);
ImagePtr pInImg = loadRawImageFile(inPath, *pInputImageGeometry);
// Sample with a generated output image
// ------------------------------------
// compute subtraction for input image
ImagePtr pAutoOutImg = squareImg(pInImg);
// Sample with a provided output image
// -----------------------------------
// create output image
ImageGeometryPtr pOutputImageGeometry = geometry2d(outType, sizeX, sizeY);
boost::shared_ptr<MemoryImage> pOutImg(boost::make_shared<MemoryImage>());
pOutImg->init(*pOutputImageGeometry);
// compute square value of input image
squareImg(pInImg, pOutImg);
See also
SquareImgLvl1
SquareImgLvl2
SquareImgLvl3

Function Documentation

◆ squareImg() [1/2]

IPSDKIPLARITHMETIC_API image::ImagePtr ipsdk::imaproc::arithm::squareImg ( const image::ImageConstPtr pInImg)

wrapper function for Computation of the square of an image, pixel by pixel

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ squareImg() [2/2]

IPSDKIPLARITHMETIC_API void ipsdk::imaproc::arithm::squareImg ( const image::ImageConstPtr pInImg,
const image::ImagePtr pOutImg 
)

wrapper function for Computation of the square of an image, pixel by pixel

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure