Table: | For specifying the system |
MIL_ID SysId, | //in |
MIL_INT64 ContextType, | //in |
MIL_INT64 ControlFlag, | //in |
MIL_ID *ContextCodeIdPtr | //out |
This function allocates a code context. A code context is a MIL object that stores one or more code models. The code model is used by the McodeRead(), McodeGrade(), McodeTrain(), and McodeWrite() operations.
To add code models to the context, use McodeModel(). A code context can contain multiple code models of 1D code types (excluding GS1 databar, Planet, Postnet, and 4-state); for other code types, a code context can contain at most one code model. To identify the types of code occurrences in an image, you can perform a McodeDetect() operation; note that a code context is not required for a McodeDetect() operation.
To adjust code model settings, use McodeControl().
When allocating a code context, specify whether the context should be initialized for a robust or a typical McodeRead(), McodeGrade(), or McodeTrain() operation. The initial configuration of the code context establishes the default values for some code context and code model settings. To change the initial configuration at a later date, use McodeControl() with M_INITIALIZATION_MODE. The explicit restrictions are indicated within the description of each code model setting; see McodeControl() for details.
To read and grade code occurrences in an image, use McodeRead() and McodeGrade(), respectively. The module only supports searching for multiple occurrences of 1D codes (excluding 4-State, GS1 Databar, Planet, and Postnet code types) and 2D Data Matrix codes. For other types of code occurrences, the module only supports searching for a single occurrence. When reading or grading multiple code occurrences, all results can be retrieved using McodeGetResult() with M_ALL. Each occurrence has a set of results.
To establish the best possible control type settings given your images, use McodeTrain().
When the code context is no longer needed, you should free it, using McodeFree().
Specifies the system on which to allocate the context. This parameter should be set to one of the following values:
For specifying the system
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_DEFAULT_HOST |
Specifies the default Host system of the current MIL application. |
||||||||||||||||||||||||||||||||||||||
MIL system identifier |
Specifies a valid system identifier, previously allocated using MsysAlloc(). |
Specifies the context type. Reserved for future expansion. This parameter must be set to M_DEFAULT.
Specifies the initial configuration for the code context. The restrictions are indicated within each control, see McodeControl() for details.
For specifying the initial configuration of the code
context
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_TYPICAL_RECOGNITION. |
||||||||||||||||||||||||||||||||||||||
M_IMPROVED_RECOGNITION |
Specifies a code context that might provide a more robust McodeRead(), McodeGrade(), or McodeTrain() operation. This initialization mode is recommended if your target images lack similarity (for example, some but not all include complex or noisy backgrounds), contain distorted code occurrences, or contain code occurrences that are at an angle or even flipped. It is also recommended when searching for 2D matrix codes that are composed of dots. Note that when selecting this mode, the default of the affected code context and code model settings might change between MIL releases to improve robustness, given new features or standard recommendations. This initialization mode is not recommended with M_PHARMACODE code types. (summarize)Specifies a code context that might provide a more robust McodeRead(), McodeGrade(), or McodeTrain() operation. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_TYPICAL_RECOGNITION |
Specifies a code context that might provide a quicker McodeRead() or McodeGrade() operation, but might potentially produce less robust results. |
Header | Include mil.h. |
Library | Use mil.lib; milcode.lib. |
DLL | Requires mil.dll; milcode.dll. |