Skip to main content

MagmPreprocess

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

Preprocess an AGM context.

Syntax

void MagmPreprocess(
AIL_ID ContextAgmId, //in
AIL_INT64 ControlFlag //in
)

Description

This function preprocesses the specified AGM context. It sets internal settings so that future search or train operations will be optimized for speed and robustness. The procedure is potentially quite lengthy (up to a few seconds) and increases the size of the AGM context significantly.

This function must be called before performing an MagmFind or MagmTrain operation. Call this function after all the required settings have been set; if some of the model's settings are changed after a call to MagmPreprocess, the model must be preprocessed again. Note that you must preprocess the context after copying a composite-definition model to a find AGM context, even if no settings are changed. When you save the AGM context, the model's preprocessing changes are not stored with the model. Upon restoration, the model must be preprocessed again.

Parameters

ContextAgmId (in, AIL_ID)

Specifies the AGM context to preprocess. The AGM context must have been previously allocated on the system using MagmAlloc with M_GLOBAL_EDGE_BASED_FIND or M_GLOBAL_EDGE_BASED_TRAIN.

ControlFlag (in, AIL_INT64)

Specifies whether to preprocess the AGM context or remove preprocessing information from the AGM context. Set this parameter to one of the following values:

For specifying whether to perform preprocessing

ValueDescription
M_DEFAULTPerforms the preprocessing of the AGM context.
M_RESETRemoves preprocessing information from the AGM context.

Removing this information can be useful if you want to conserve computer memory within an application and preserve AGM context settings. |

Copyright © 2026 Zebra Technologies.