IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Addition between a ponderated image and a scalarSee full documentation
imagemultiplyAddScalarImg (inImg,inFactor,inOffset)

Detailed Description

affine operation on grey levels of an image

On output image values are given by:

\[ OutImg[i] = InFactor * InImg[i] + InOffset \]

with $ InFactor $ and $ InOffset $ parameters of the operations specified by the user.

The result of the operation automatically saturates if it is out of output image data type range.

Input and output images must have same size.

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLArithmetic as arithm

Code Example

# opening input image
geometry = PyIPSDK.geometry2d(PyIPSDK.eImageBufferType.eIBT_Real32, 510, 509)
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# affine operation on the input image
outImg = arithm.multiplyAddScalarImg(inImg, 1.5, 10.0)

Example of C++ code :

Example informations

Header file

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

Code Example

// Sample with a generated output image
// ------------------------------------
// compute multiplication for input images
ImagePtr pAutoOutImg = multiplyAddScalarImg(pInImg, factor, offset);
// 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 multiplication of input images
multiplyAddScalarImg(pInImg, factor, offset, pOutImg);