IPSDK 4.2
IPSDK : Image Processing Software Development Kit
Image Equality
image = isEqualImgImg (inImg1,inImg2)
image = isEqualImgImg (inImg1,inImg2,bIngoreBackground)
image = isEqualImgImg (inImg1,inImg2,tolerance)
image = isEqualImgImg (inImg1,inImg2,tolerance,bIngoreBackground)

Detailed Description

Set the pixels to true in the ouput binary images if the two input images are equal according to a tolerance.

This algorithm compares the two input images. The pixel in the output image is set to 1 if the corresponding pixels in the input images are similar, according to a tolerance.

\[ OutImg[i] = \begin{cases} 1, & \text{if } | InImg1[i] - InImg2[i]| < \text{tol} \\ 0, & \text{ otherwise }\end{cases} \]

IsEqualImgImg.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLLogical as logic

Code Example

# opening of input images
inGeometry = PyIPSDK.geometry2d(PyIPSDK.eImageBufferType.eIBT_UInt8, 510, 509)
inImg1 = PyIPSDK.loadRawImageFile(inputImgPath1, inGeometry)
inImg2 = PyIPSDK.loadRawImageFile(inputImgPath2, inGeometry)
# Comparison
outImg = logic.isEqualImgImg(inImg1, inImg2)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLLogical/Processor/IsEqualImgImg/IsEqualImgImg.h>

Code Example

// opening input images
ImageGeometryPtr pImageGeometry = geometry2d(imageBufferType, sizeX, sizeY);
ImagePtr pInImg1 = loadRawImageFile(inputImg1Path, *pImageGeometry);
ImagePtr pInImg2 = loadRawImageFile(inputImg2Path, *pImageGeometry);
// comparison of images without tolerance
ImagePtr pOutImg_NoTol = isEqualImgImg(pInImg1, pInImg2);
// comparison of images with tolerance
ImagePtr pOutImg_Tol = isEqualImgImg(pInImg1, pInImg2, createImgComparisonAbsTolerance(absTolerance));