image = | multiplyScalarImg (inImg,inArithmeticVal) |
multiplication of an input image and a scalar
Multiplication of an input image InImg and a scalar InArithmeticVal. On output image values are given by:
Input and output images must have same size.
The scalar value is cast into the greatest type between the input and the output image. If both images have integer values whereas the salar has a real value, precision will be lost.
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLArithmetic as arithm
Code Example
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
outImg = arithm.multiplyScalarImg(inImg, 3.0)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLArithmetic/Processor/MultiplyScalarImg/MultiplyScalarImg.h>
Code Example
ImagePtr pAutoOutImg = multiplyScalarImg(pInImg, fInArithmeticVal);
boost::shared_ptr<MemoryImage> pOutImg(boost::make_shared<MemoryImage>());
pOutImg->init(*pOutputImageGeometry);
multiplyScalarImg(pInImg, fInArithmeticVal, pOutImg);