Skip to main content

MimLocateDifference

BoardSupported
Host SystemYes
V4L2Yes
Clarity UHDYes
Concord PoENo
GenTLYes
GevIQYes
GigE VisionYes
IndioNo
Iris GTXYes
Radient eV-CLYes
Rapixo CLYes
Rapixo CoFYes
Rapixo CXPYes
USB3 VisionYes

Locate the differences between 2 buffers, with some tolerance.

Syntax

AIL_INT MimLocateDifference(
AIL_ID LocateDifferenceContextImId, //in
AIL_ID Src1ImageBufId, //in
AIL_ID Src2ImageBufId, //in
AIL_ID LocateDifferenceResultImId, //out
AIL_DOUBLE AbsTolerance, //in
AIL_DOUBLE RelTolerance, //in
AIL_INT64 ControlFlag //in
)

Description

This function locates the differences between 2 buffers, with some tolerance, and put the positions and values of the 2 sources in the result object. Absolute and relative tolerances will be taken in account to determine if the pixels are different. You can limit this function's results to a region of the source image buffers using a region of interest (ROI) set using MbufSetRegion.

Parameters

LocateDifferenceContextImId (in, AIL_ID)

Specifies the predefined locate difference context to use.

For specifying the locate difference context identifier

ValueDescription
M_DEFAULT
M_LOCATE_DIFFERENCE_CONTEXT_TOLERANCE_MAX (default)Specifies a predefined locate difference context that takes the maximum of the absolute tolerance and the relative tolerance applied on the maximum absolute value.
M_LOCATE_DIFFERENCE_CONTEXT_TOLERANCE_SUMSpecifies a predefined locate difference context that takes the sum of the absolute tolerance and the relative tolerance applied on the maximum absolute value.

Src1ImageBufId (in, AIL_ID)

Specifies the identifier of the first source image buffer.

Src2ImageBufId (in, AIL_ID)

Specifies the identifier of the second source image buffer.

LocateDifferenceResultImId (out, AIL_ID)

Specifies the identifier of the image processing locate difference result buffer in which to write the results. The object must have previously allocated using MimAllocResult with M_LOCATE_DIFFERENCE_RESULT.

For specifying the image processing locate difference result buffer identifier

ValueDescription
M_NULLSpecifies to not use an image processing locate difference result buffer. In this case, the function will return the number of differences.
LocateDifferenceResultImIdSpecifies the identifier of the image processing locate difference result buffer in which to write the results.

AbsTolerance (in, AIL_DOUBLE)

Specifies an absolute tolerance.

For specifying the absolute tolerance

ValueDescription
M_DEFAULT
Value >= 0.0 (default)Specifies the absolute tolerance.

RelTolerance (in, AIL_DOUBLE)

Specifies a relative tolerance. Relative tolerance is applied on the highest absolute value.

For specifying the relative tolerance

ValueDescription
M_DEFAULT
0.0 <= Value <= 1.0 (default)Specifies the relative tolerance.

ControlFlag (in, AIL_INT64)

Reserved for future expansion and must be set to M_DEFAULT.

Return Value

Type: AIL_INT

If LocateDifferenceResultImId is M_NULL, the returned value is the number of differences. If LocateDifferenceResultImId is not M_NULL, the returned value is M_INVALID.

Copyright © 2026 Zebra Technologies.