Skip to main content

MimLocateEvent

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

Find pixel coordinates or values that satisfy a specified condition.

Syntax

AIL_INT MimLocateEvent(
AIL_ID SrcImageBufId, //in
AIL_ID EventResultImId, //out
AIL_INT64 Condition, //in
AIL_DOUBLE CondLow, //in
AIL_DOUBLE CondHigh //in
)

Description

This function finds the coordinates and value of the pixels that satisfy the specified condition in the specified source image. Results are stored in the specified event result buffer.

You can retrieve the values, X- or Y-coordinates, and the number of pixels that satisfy the condition, using MimGetResult or MimGetResult1d. If the result buffer does not have the required number of entries to hold the total number of events that satisfy the condition, the number returned will be limited to the number of entries in the result buffer.

You can limit this function's results to a region of the source image buffer using a region of interest (ROI) set using MbufSetRegion.

Parameters

SrcImageBufId (in, AIL_ID)

Specifies the identifier of the source image for the operation. This parameter must be given the identifier of a 1-band buffer.

EventResultImId (out, AIL_ID)

Specifies the identifier of the buffer in which to store the event results. This parameter must be given the identifier of an image processing result buffer, allocated using MimAllocResult with an M_EVENT_LIST type. The buffer must have enough entries to hold the expected number of events.

Condition (in, AIL_INT64)

Specifies the condition under which pixel values are considered an event. This parameter must be set to one of the values below.

For conditions that use two limits

ValueDescription
M_IN_RANGESpecifies that pixels with values between CondLow and CondHigh, inclusive, are considered events.
M_OUT_RANGESpecifies that pixels with values less than CondLow, or greater than CondHigh, are considered events.

For conditions that use one limit

ValueDescription
M_EQUALSpecifies that only pixels with values equal to CondLow will be considered an event.
M_GREATERSpecifies that only pixels with values greater than CondLow will be considered an event.
M_GREATER_OR_EQUALSpecifies that only pixels with values greater than or equal to the CondLow will be considered an event.
M_LESSSpecifies that only pixels with values less than CondLow will be considered an event.
M_LESS_OR_EQUALSpecifies that only pixels with values less than or equal to CondLow will be considered an event.
M_NOT_EQUALSpecifies that only pixels with values not equal to CondLow will be considered an event.

For conditions that use no limit

ValueDescription
M_ALLSpecifies that all pixels satisfying the local maxima or local minima condition will be considered an event. If you do not specify a local maxima or local minima condition, M_ALL results in the coordinates and value of all the source pixels.

For specifying a local maxima or local minima as part of the condition

ValueDescription
M_LOCAL_MAX_NOT_STRICTSpecifies that within a 3x3 neighborhood of a pixel, the pixel must be equal to or greater than all of its neighbors for it to be considered an event.
=<=<=<
=<X=<
=<=<=<

The following is an example that shows a pixel, at the center of its 3x3 neighborhood, that satisfies the M_LOCAL_MAX_NOT_STRICT condition.

555
555
555
M_LOCAL_MAX_STRICT_MEDIUMSpecifies that within a 3x3 neighborhood of a pixel, the pixel must be equal to or greater than all of its neighbors, and it must also be greater than the pixels on its left and the pixel below, for it to be considered an event.
<=<=<
<X=<
<<=<

The following is an example that shows a pixel, at the center of its 3x3 neighborhood, that satisfies the M_LOCAL_MAX_STRICT_MEDIUM condition.

455
455
445
M_LOCAL_MIN_NOT_STRICTSpecifies that within a 3x3 neighborhood of a pixel, the pixel must be equal to or less than all of its neighbors for it to be considered an event.
=>=>=>
=>X=>
=>=>=>

The following is an example that shows a pixel, at the center of its 3x3 neighborhood, that satisfies the M_LOCAL_MIN_NOT_STRICT condition.

444
444
444
M_LOCAL_MIN_STRICT_MEDIUMSpecifies that within a 3x3 neighborhood of a pixel, the pixel must be equal to or less than all of its neighbors, and it must also be less than the pixels on its left and the pixel below, for it to be considered an event.
>=>=>
>X=>
>>=>

The following is an example that shows a pixel, at the center of its 3x3 neighborhood, that satisfies the M_LOCAL_MIN_STRICT_MEDIUM condition.

544
544
554

CondLow (in, AIL_DOUBLE)

Specifies the lower limit of the selected condition.

For specifying the lower limit

ValueDescription
M_NULLSpecifies that no lower limit is required. This setting should be selected for conditions that use M_ALL.
ValueSpecifies the lower limit.

CondHigh (in, AIL_DOUBLE)

Specifies the upper limit of the selected condition.

For specifying the upper limit

ValueDescription
M_NULLSpecifies that no upper limit is required. This setting should be selected for conditions that use one limit or M_ALL.
ValueSpecifies the upper limit.

Return Value

Type: AIL_INT

If EventResultImId is M_NULL, the returned value is the number of pixels that satisfy the specified condition in the specified source image. If EventResultImId is not M_NULL, the returned value is M_INVALID. In that case, use either MimGetResult or MimGetResult1d, with M_NB_EVENT as the result type, to retrieve the number of pixels that satisfy the specified condition.

Copyright © 2026 Zebra Technologies.