IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

maximum of the absolute values of 2 images, pixel by pixel More...

IPSDKIPLARITHMETIC_API void ipsdk::imaproc::arithm::maxAbsImgImg (const image::ImageConstPtr &pInImg1, const image::ImageConstPtr &pInImg2, const image::ImagePtr &pOutImg)
 wrapper function for maximum of absolute values of 2 images, pixel by pixel More...
 
IPSDKIPLARITHMETIC_API image::ImagePtr ipsdk::imaproc::arithm::maxAbsImgImg (const image::ImageConstPtr &pInImg1, const image::ImageConstPtr &pInImg2)
 wrapper function for maximum of absolute values of 2 images, pixel by pixel More...
 

Detailed Description

maximum of the absolute values of 2 images, pixel by pixel

On output image values are given by:

\[ OutImg[i] = \begin{cases} \lvert InImg1[i] \rvert, & \text{if } \lvert InImg1[i] \rvert \geq \lvert InImg2[i] \rvert \\ \lvert InImg2[i] \rvert, & \text{otherwise} \end{cases} \]

Input and output images must have same size.

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg1 [Input] First image for processing operation X
ipsdk::imaproc::attr::InImg2 [Input] Second image for processing operation X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation promoteBinary (_pOutImg, _pInImg1, _pInImg2, ipsdk::imaproc::ePromoteBinaryType::ePBT_MaxAbs)

Global Rule description

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

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLArithmetic as arithm

Code Example

# opening input images
geometry = PyIPSDK.geometry2d(PyIPSDK.eImageBufferType.eIBT_Real32, 510, 509)
inImg1 = PyIPSDK.loadRawImageFile(inputImg1Path, geometry)
inImg2 = PyIPSDK.loadRawImageFile(inputImg2Path, geometry)
# computation of maxima of absolute values of the 2 input images
outImg = arithm.maxAbsImgImg(inImg1, inImg2)

Example of C++ code :

Example informations

Associated library

IPSDKIPLArithmetic

Header file

Code Example

// open input images
ImageGeometryPtr pInputImageGeometry = geometry2d(inType, sizeX, sizeY);
ImagePtr pInImg1 = loadRawImageFile(in1Path, *pInputImageGeometry);
ImagePtr pInImg2 = loadRawImageFile(in2Path, *pInputImageGeometry);
// Sample with a generated output image
// ------------------------------------
// compute maximum of absolute values for input images
ImagePtr pAutoOutImg = maxAbsImgImg(pInImg1, pInImg2);
// 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 maximum of absolute values of input images
maxAbsImgImg(pInImg1, pInImg2, pOutImg);
See also
MaxAbsImgImgLvl1
MaxAbsImgImgLvl2
MaxAbsImgImgLvl3

Function Documentation

◆ maxAbsImgImg() [1/2]

IPSDKIPLARITHMETIC_API void ipsdk::imaproc::arithm::maxAbsImgImg ( const image::ImageConstPtr pInImg1,
const image::ImageConstPtr pInImg2,
const image::ImagePtr pOutImg 
)

wrapper function for maximum of absolute values of 2 images, pixel by pixel

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ maxAbsImgImg() [2/2]

IPSDKIPLARITHMETIC_API image::ImagePtr ipsdk::imaproc::arithm::maxAbsImgImg ( const image::ImageConstPtr pInImg1,
const image::ImageConstPtr pInImg2 
)

wrapper function for maximum of absolute values of 2 images, pixel by pixel

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure