image = | genericAddImgImg (inImg1,inImg2) |
function for add images with different dimensions
Addition of 2 images with different dimensions (volume with plan, volume color with volume...). The image with the highest dimensions always have to be the first one.
The output image values are given by:
Here is an example of a generic addition operation, applied to two 8-bits grey level images, the first one is a 3D image (z=3) and the second one is a 2D image :
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLArithmetic as arithm
Code Example
inGeometry = PyIPSDK.geometry2d(PyIPSDK.eImageBufferType.eIBT_UInt8, 510, 509)
inImg1 = PyIPSDK.loadTiffImageFile(inputImg1Path)
inImg2 = PyIPSDK.loadTiffImageFile(inputImg2Path)
outImg = arithm.genericAddImgImg(inImg1, inImg2)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLArithmetic/Processor/GenericAddImgImg/GenericAddImgImg.h>
Code Example
ImagePtr pOutImgAuto = genericAddImgImg(pInImg1, pInImg2);
boost::shared_ptr<MemoryImage> pOutImg(boost::make_shared<MemoryImage>());
pOutImg->init(*pOutputImageGeometry);
genericAddImgImg(pInImg1, pInImg2, pOutImg);