| MIL 10 Reference
| Customize Help
| Save Settings

MimLocateEvent



See also
Availability
Not available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
Synopsis
Find pixel coordinates or values that satisfy a specified condition.
Syntax
MIL_INT MimLocateEvent(
MIL_ID SrcImageBufId, //in
MIL_ID EventResultImId, //in
MIL_INT64 Condition, //in
MIL_DOUBLE CondLow, //in
MIL_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().

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
SrcImageBufId

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

This image buffer can have an ROI set using MbufSetRegion(). The ROI must be defined in raster format (M_RASTER or M_VECTOR_AND_RASTER). An error is generated if the ROI is only in vector format (M_VECTOR).

EventResultImId

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.

If the number of pixels found is less than the number of event result buffer entries, the remaining result buffer entries are set to M_INVALID. If the number of events is greater than the number of allocated result buffer entries, the extra entries are discarded; when using multi-processing, the events kept might not be the first events in the source image. To determine the number of events so that you can allocate an appropriate result buffer, call MimLocateEvent() with EventResultImId set to M_NULL. The returned value is the number of pixels that satisfy the condition. Use this value to allocate a result buffer of the correct size. You then call this function a second time, specifying a result buffer with the correct size.

Condition

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, set the Condition parameter to one of the values below.

function map For conditions that use two limits
CollapseValue Description
Collapse M_IN_RANGE +

Specifies that pixels with values between CondLow and CondHigh, inclusive, are considered events.

Collapse M_OUT_RANGE

Specifies that pixels with values less than CondLow, or greater than CondHigh, are considered events.

For conditions that use one limit, set the Condition parameter to one of the values below.

function map For conditions that use one limit
CollapseValue Description
Collapse M_EQUAL

Specifies that only pixels with values equal to CondLow will be considered an event.

Collapse M_GREATER

Specifies that only pixels with values greater than CondLow will be considered an event.

Collapse M_GREATER_OR_EQUAL +

Specifies that only pixels with values greater than or equal to the CondLow will be considered an event.

Collapse M_LESS

Specifies that only pixels with values less than CondLow will be considered an event.

Collapse M_LESS_OR_EQUAL +

Specifies that only pixels with values less than or equal to CondLow will be considered an event.

Collapse M_NOT_EQUAL

Specifies that only pixels with values not equal to CondLow will be considered an event.

For conditions that use no limit, set the Condition parameter to the value below. Typically, this is only useful when specifying a local maxima or local minima condition.

function map For conditions that use no limit
CollapseValue Description
Collapse M_ALL +

Specifies 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.

(summarize)

You can add one of the following values to the above-mentioned values to specify a local maxima or local minima as part of the condition under which pixel values are considered an event.

The local maxima or local minima condition only applies to pixels that meet the initial condition (for example, M_IN_RANGE).

You cannot use MimStat() with a local maxima or local minima condition to determine the number of event result buffer entries so that you can allocate an appropriate result buffer. Instead, you can use MimStat() with the initial condition only (for example, M_IN_RANGE) except M_ALL. However, since this is typically an unnecessarily large number, you should consider the specifics of your application to allocate a more appropriate result buffer.

function map For specifying a local maxima or local minima as part of the condition
CollapseCombination value Description
Collapse M_LOCAL_MAX_NOT_STRICT

Specifies 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.

5

5

5

5

5

5

5

5

5

(summarize)
Collapse M_LOCAL_MAX_STRICT_MEDIUM

Specifies 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.

4

5

5

4

5

5

4

4

5

(summarize)
Collapse M_LOCAL_MIN_NOT_STRICT

Specifies 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.

4

4

4

4

4

4

4

4

4

(summarize)
Collapse M_LOCAL_MIN_STRICT_MEDIUM

Specifies 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.

5

4

4

5

4

4

5

5

4

(summarize)
CondLow

Specifies the lower limit of the selected condition.

function map For specifying the lower limit
CollapseValue Description
Collapse M_NULL

Specifies that no lower limit is required. This setting should be selected for conditions that use M_ALL.

(summarize)
Collapse Value

Specifies the lower limit.

CondHigh

Specifies the upper limit of the selected condition.

function map For specifying the upper limit
CollapseValue Description
Collapse M_NULL

Specifies that no upper limit is required. This setting should be selected for conditions that use one limit or M_ALL.

(summarize)
Collapse Value

Specifies the upper limit.

Return value
The returned value is the number of pixels that satisfy the specified condition in the specified source image.
Compilation information
Header Include mil.h.
Library Use mil.lib; milim.lib.
DLL Requires mil.dll; milim.dll.
PROC VECTOR IN RANGE OUT RANGE EQUAL GREATER GREATER OR EQUAL LESS LESS OR EQUAL NOT EQUAL ALL LOCAL MAX NOT STRICT LOCAL MAX STRICT MEDIUM LOCAL MIN NOT STRICT LOCAL MIN STRICT MEDIUM NULL NULL