Skip to main content

MagmFind

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 the specified model in the target image or Edge Finder result buffer.

Syntax

void MagmFind(
AIL_ID ContextAgmId, //in
AIL_ID TargetImageOrResultId, //in
AIL_ID ResultAgmId, //out
AIL_INT64 ControlFlag //in
)

Description

This function searches for the model, defined in the specified find AGM context, in the specified target image or Edge Finder result buffer. Results are stored in the specified find AGM result buffer. You can retrieve results using MagmGetResult. Note that calling MagmFind successively with target images of different sizes will slow the execution time.

This function only searches for single-definition models or trained composite-definition models. You can train a composite-definition model using MagmTrain, and then copy the resulting model to a find AGM context using MagmCopyResult with M_TRAINED_MODEL.

Use MagmControl to configure individual model settings before calling this function.

An occurrence is selected as a candidate if its coverage, fit, and detection scores are greater than or equal to the respective acceptance levels (MagmControl with M_ACCEPTANCE_COVERAGE, M_ACCEPTANCE_FIT, and M_ACCEPTANCE_DETECTION).

This function returns results in decreasing coverage, fit, or detection score order, depending on MagmControl with M_SORT_CANDIDATES_SCORE. This means that the most-likely occurrence is always returned first.

If you are searching for the model in an Edge Finder result buffer, MagmFind will search for the model only in the included edges of the Edge Finder result buffer.

Note that AGM does not provide support for camera calibration. If you are searching for the model in a target image buffer, the target image buffer must be uncalibrated. If you are searching in an Edge Finder result buffer, the Edge Finder result buffer must be uncalibrated or M_RESULT_OUTPUT_UNITS must be set to M_PIXEL.

The AGM context must be preprocessed with MagmPreprocess before calling this function.

Parameters

ContextAgmId (in, AIL_ID)

Specifies the find AGM context identifier to use for the search. The AGM context must have been previously allocated on the system using MagmAlloc with M_GLOBAL_EDGE_BASED_FIND.

TargetImageOrResultId (in, AIL_ID)

Specifies the identifier of the target image or Edge Finder result buffer in which to find the model.

For specifying the target in which to search

ValueDescription
Edge Finder result buffer identifierSpecifies the identifier of the Aurora Imaging Library Edge Finder result buffer in which to find the model. The Edge Finder result buffer must have been previously allocated on the required system using MedgeAllocResult; MedgeCalculate must have already been called. In addition, the Edge Finder result buffer must be compatible with the AGM context. Enable compatibility using MedgeControl with M_AGM_COMPATIBLE prior to calling MedgeCalculate.

Note that because AGM does not support calibration, the Edge Finder result buffer must be uncalibrated or M_RESULT_OUTPUT_UNITS must be set to M_PIXEL.

This value is not available when M_USE_MAGNITUDE_TARGET is set to M_ENABLE. | | Image buffer identifier | Specifies the identifier of the Aurora Imaging Library image buffer in which to find the model. The image buffer must be a 1-band 8-bit unsigned buffer. The minimum and maximum target image sizes are 6x6 and 32768x32768 pixels, respectively. It is important to note that the minimum and maximum target image sizes are Aurora Imaging Library limits. To make sure that you have enough memory, you can call MagmFind; if you don't have enough memory, you will get an Aurora Imaging Library error.

This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.

Note that because AGM does not support calibration, the image buffer must be uncalibrated. |

ResultAgmId (out, AIL_ID)

Specifies the identifier of the find AGM result buffer in which to store results. The result buffer must have been allocated using MagmAllocResult with M_GLOBAL_EDGE_BASED_FIND_RESULT.

ControlFlag (in, AIL_INT64)

Reserved for future expansion. This parameter must be set to M_DEFAULT.

Copyright © 2026 Zebra Technologies.