| Customize Help
| Save Settings

MclassAlloc



Function Map
Synopsis
Allocate a classifier context, a dataset context, or a training context.
Syntax
MIL_ID MclassAlloc(
MIL_ID SysId, //in
MIL_INT64 ContextType, //in
MIL_INT64 ControlFlag, //in
MIL_ID *ContextClassIdPtr //out
)
Description

This function allocates a classifier context, a dataset context, or a training context on the specified system. These contexts are either for a predefined CNN (convolutional neural network) classifier or a tree ensemble classifier.

When the context is no longer required, you should release its memory, using MclassFree().

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 which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
SysId

Specifies the identifier of the system on which to allocate the context. Set this parameter to one of the following values:

function map For specifying the system
Click to summarizeValue Description
Click to summarize M_DEFAULT_HOST

Specifies the default Host system of the current MIL application.

Click to summarize MIL system identifier

Specifies a valid system identifier, previously allocated using MsysAlloc().

ContextType

Specifies the type of context to allocate. Set this parameter to one of the following values:

function map For specifying the type of context to allocate
Click to summarizeValue Description
Click to summarize M_CLASSIFIER_CNN_PREDEFINED

Specifies to allocate a predefined CNN classifier context. Typically, you should set the ControlFlag parameter to a specific CNN classifier context that Matrox has predefined.

When you allocate a classifier context, you must typically train it (MclassTrain()) before predicting with it (MclassPredict()).

(summarize)
Click to summarize M_CLASSIFIER_TREE_ENSEMBLE

Specifies to allocate a tree ensemble classifier context.

When you allocate a classifier context, you must typically train it (MclassTrain()) before predicting with it (MclassPredict()).

(summarize)
Click to summarize M_DATASET_FEATURES

Specifies to allocate a features dataset context.

This context holds the feature data with which to train a tree ensemble classifier (M_CLASSIFIER_TREE_ENSEMBLE).

(summarize)
Click to summarize M_DATASET_IMAGES

Specifies to allocate an images dataset context.

This dataset holds the image data with which to train a CNN classifier (M_CLASSIFIER_CNN_PREDEFINED).

You can also use an images dataset context with MclassPredict() to label images in an existing dataset (assisted labeling).

(summarize)
Click to summarize M_TRAIN_CNN

Specifies to allocate a CNN training context.

This context holds the training settings with which to train a CNN classifier context, using MclassTrain().

(summarize)
Click to summarize M_TRAIN_TREE_ENSEMBLE

Specifies to allocate a tree ensemble training context.

This context holds the training settings with which to train a tree ensemble classifier context, using MclassTrain().

(summarize)
ControlFlag

Specifies which predefined CNN classifier context to use. These classifier contexts are built by Matrox; you cannot modify their underlying architecture.

You must set this parameter to M_DEFAULT if you are not allocating a predefined CNN classifier context (M_CLASSIFIER_CNN_PREDEFINED).

function map For specifying which predefined CNN classifier context to use
Click to summarizeValue Description
Click to summarize M_DEFAULT

Specifies no predefined CNN classifier context. M_DEFAULT is the only possible setting when you are not allocating a predefined CNN classifier context.

You cannot directly train a predefined CNN classifier context if you specify M_DEFAULT. In this case, you would typically copy a resulting trained context into this context (MclassCopyResult()).

(summarize)
Click to summarize M_FCNET_COLOR_XL

Specifies an extra large FCNet classifier context that is for color images. Note, this corresponds to the FCNET_COLOR_XL.mclass context file that MIL installed.

This classifier is intended for transfer learning. It has a minimum image size (receptive field) of 195 pixels and a step size of 32 pixels. You must use color (3-band) images with this classifier.

(summarize)
Click to summarize M_FCNET_M

Specifies a medium FCNet classifier context. Note, this corresponds to the FCNET_M.mclass context file that MIL installed.

This classifier is for a complete training. It has a minimum image size (receptive field) of 83 pixels and a step size of 8 pixels. You can use grayscale (1-band) or color (3-band) images with this classifier.

(summarize)
Click to summarize M_FCNET_MONO_XL

Specifies an extra large FCNet classifier context that is for monochrome images. Note, this corresponds to the FCNET_MONO_XL.mclass context file that MIL installed.

This classifier is intended for transfer learning. It has a minimum image size (receptive field) of 195 pixels and a step size of 32 pixels. You must use grayscale (1-band) images with this classifier.

(summarize)
Click to summarize M_FCNET_S

Specifies a small FCNet classifier context. Note, this corresponds to the FCNET_S.mclass context file that MIL installed.

This classifier is for a complete training. It has a minimum image size (receptive field) of 43 pixels and a step size of 4 pixels. You can use grayscale (1-band) or color (3-band) images with this classifier.

(summarize)
Click to summarize M_FCNET_XL

Specifies an extra large FCNet classifier context. Note, this corresponds to the FCNET_XL.mclass context file that MIL installed.

This classifier is for a complete training. It has a minimum image size (receptive field) of 195 pixels and a step size of 32 pixels. You can use grayscale (1-band) or color (3-band) images with this classifier.

(summarize)
ContextClassIdPtr

Specifies the address of the variable in which to write the context identifier. Since MclassAlloc() also returns the context identifier, you can set this parameter to M_NULL.

Return value
The returned value is the context's identifier if the allocation is successful. If allocation fails, M_NULL is returned.
Compilation information
Header Include mil.h.
Library Use mil.lib; milclass.lib.
DLL Requires mil.dll; milclass.dll.
DEFAULT HOST CLASSIFIER CNN PREDEFINED CLASSIFIER TREE ENSEMBLE DATASET FEATURES DATASET IMAGES TRAIN CNN TRAIN TREE ENSEMBLE DEFAULT FCNET COLOR XL FCNET M FCNET MONO XL FCNET S FCNET XL CLASSIFIER CNN PREDEFINED