MIL_ID ContextId, | //in |
MIL_INT Index, | //in |
MIL_ID MaskBufferId, | //in |
MIL_INT64 MaskType, | //in |
MIL_INT64 ControlFlag | //in |
This function allows you to apply masks to a model. Each mask can set pixels in the specified model to one of three states: a "don't care" state, a "flat region" state, or a "weighted region" state. You can apply different types of masks with the same model by making multiple calls to this function. Note that "don't care" and "flat region" masks are not supported for synthetic models.
"Don't care" pixels in a model will not be considered when searching for occurrences of the model in the target.
"Flat region" pixels denote a region where no features are expected, other than consistent pixel values with no edges present; any edge found in a "flat region" reduces the target score.
"Weighted region" pixels denote that the extracted model features will have weights to indicate their importance in the occurrence. The weight of the features will affect the calculation of the score; although the weights themselves don't affect the target score, features corresponding to negative weights will be ignored when calculating the target score.
Note that if you modify the margin of a synthetic model's bounding box after a mask has been applied, the mask will be discarded since it is no longer the same size as the model.
Note that this function does not support an M_SHAPE_CIRCLE type of Model Finder context.
Specifies the Model Finder context of the model to mask. For this parameter, you can only specify M_GEOMETRIC or M_GEOMETRIC_CONTROLLED type of Model Finder contexts. The Model Finder context must have been previously allocated on the system using MmodAlloc().
Specifies the individual model for which to create a mask.
For specifying a model
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the default value; the default value is 0. |
||||||||||||||||||||||||||||||||||||||
Value >= 0 |
Specifies the index of the model for which the mask is being created. (more details...) |
Specifies the identifier of the image buffer used to identify the masked pixels in the model. This buffer must be a 1-band 8-bit unsigned buffer for a "don't care" or "flat region" mask. For a "weighted region" mask, the buffer must be a 1-band 8-bit signed buffer. The buffer must be of the same size as the model. This buffer can be calibrated; however, even if the model is calibrated, the mask is applied on a pixel basis. Setting the MaskBufferId parameter to M_NULL when the MaskType parameter is set to M_DONT_CARE, M_FLAT_REGIONS, or M_WEIGHT_REGIONS removes the mask.
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.
Specifies which type of mask to employ. Set this parameter to one of the following values:
For specifying the type of
mask
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DONT_CARE |
Specifies that features present in the masked region (non-zero pixels) are ignored during the search. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_FLAT_REGIONS |
Specifies that no features are expected in the masked region (non-zero pixels). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_WEIGHT_REGIONS |
Specifies that the pixels corresponding to the model's active edges are weighted according to the values of the weighted region mask. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; milmod.lib. |
DLL | Requires mil.dll; milmod.dll. |