IPSDK 0.2
IPSDK : Image Processing Software Development Kit
imageminImgImg (inImg1,inImg2)

Detailed Description

minimum of 2 images, pixel by pixel algorithm

On output image values are given by:

\[ OutImg[i] = \begin{cases} InImg1[i], & \text{if }InImg1[i] \leq InImg2[i] \\ InImg2[i], & \text{otherwise} \end{cases} \]

Input and output images must have same size.

Here is an example of a minimum operation applied to two 8-bits grey level images:

minImgImg.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLArithmetic as arithm

Code Example

# opening input images
geometry = PyIPSDK.geometry2d(PyIPSDK.eImageBufferType.eIBT_Real32, 510, 509)
inImg1 = PyIPSDK.loadRawImageFile(inputImg1Path, geometry)
inImg2 = PyIPSDK.loadRawImageFile(inputImg2Path, geometry)
# computation of minimum of the 2 input images
outImg = arithm.minImgImg(inImg1, inImg2)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLArithmetic/Processor/MinImgImg/MinImgImg.h>

Code Example

// open input images
ImageGeometryPtr pInputImageGeometry = geometry2d(inType, sizeX, sizeY);
ImagePtr pInImg1 = loadRawImageFile(in1Path, *pInputImageGeometry);
ImagePtr pInImg2 = loadRawImageFile(in2Path, *pInputImageGeometry);
// Sample with a generated output image
// ------------------------------------
// compute absolute value of input images
ImagePtr pAutoOutImg = minImgImg(pInImg1, pInImg2);
// Sample with a provided output image
// -----------------------------------
// create output image
ImageGeometryPtr pOutputImageGeometry = geometry2d(outType, sizeX, sizeY);
boost::shared_ptr<MemoryImage> pOutImg(boost::make_shared<MemoryImage>());
pOutImg->init(*pOutputImageGeometry);
// compute minimum of input images
minImgImg(pInImg1, pInImg2, pOutImg);