image = | multiplyAddScalarImg (inImg,inFactor,inOffset) |
affine operation on grey levels of an image
On output image values are given by:
with
and
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
geometry = PyIPSDK.geometry2d(PyIPSDK.eImageBufferType.eIBT_Real32, 510, 509)
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
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
ImagePtr pAutoOutImg = multiplyAddScalarImg(pInImg, factor, offset);
boost::shared_ptr<MemoryImage> pOutImg(boost::make_shared<MemoryImage>());
pOutImg->init(*pOutputImageGeometry);
multiplyAddScalarImg(pInImg, factor, offset, pOutImg);