image = | subtractImgImg (inImg1,inImg2) |
subtraction of 2 images
On output image values are given by:
Input and output images must have same size.
Here is an example of a subtraction operation applied to two 8-bits grey level images:
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLArithmetic as arithm
Code Example
geometry = PyIPSDK.geometry2d(PyIPSDK.eImageBufferType.eIBT_Real32, 510, 509)
inImg1 = PyIPSDK.loadRawImageFile(inputImg1Path, geometry)
inImg2 = PyIPSDK.loadRawImageFile(inputImg2Path, geometry)
outImg = arithm.subtractImgImg(inImg1, inImg2)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLArithmetic/Processor/SubtractImgImg/SubtractImgImg.h>
Code Example
ImagePtr pAutoOutImg = subtractImgImg(pInImg1, pInImg2);
boost::shared_ptr<MemoryImage> pOutImg(boost::make_shared<MemoryImage>());
pOutImg->init(*pOutputImageGeometry);
subtractImgImg(pInImg1, pInImg2, pOutImg);