image = | subtractScalarImg (inArithmeticVal,inImg) |
subtraction of a scalar and an image (scalar - image)
Subtraction of a scalar InArithmeticVal and an input image InImg. 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.subtractScalarImg(250.0, inImg)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLArithmetic/Processor/SubtractScalarImg/SubtractScalarImg.h>
Code Example
ImagePtr pAutoOutImg = subtractScalarImg(fInArithmeticVal, pInImg);
boost::shared_ptr<MemoryImage> pOutImg(boost::make_shared<MemoryImage>());
pOutImg->init(*pOutputImageGeometry);
subtractScalarImg(fInArithmeticVal, pInImg, pOutImg);