Synopsis
Set the pattern matching model’s “don’t care” pixels.
Format
void MpatSetDontCare(ModelId, ImageBufId, OffX, OffY, Value)
MIL_ID ModelId; | Model identifier |
MIL_ID ImageBufId; | “Don’t-care” image buffer identifier |
long OffX; | Start of “don’t care” mask in X direction |
long OffY; | Start of “don’t care” mask in Y direction |
long Value; | Pixel value in image to be considered as “don’t care” value |
Description
This function sets pixels in the specified model to a “don’t care” state. To determine which model pixels to set, a region of the specified image buffer, starting at the specified offset and equal in size to the model, is compared with the specified “don’t care” value. If an image pixel is equal to this value, the corresponding pixel in the model is set to “don’t care”. The “don’t care” pixels of the model will not be considered when pattern matching with this model, using MpatFindModel or MpatFindMultipleModel.
Note, each time this function is called, a new set of “don’t care” pixels is assigned to the specified model, superseding any existing set. Therefore, in multiple calls to this function, the effect is not cumulative. Also, whenever the “don’t care” pixels in a model change, the effect of any preprocessing of the model is undone. Therefore, if you want a preprocessed model, call MpatPreprocModel after calling MpatSetDontCare.
The ModelId parameter specifies the identifier of the model in which “don’t care” pixels will be set.
The ImageBufId parameter specifies the identifier of the image buffer used to identify which pixels in the model will be set to “don’t care”. This buffer must be at least as large as the model.
The OffX and OffY parameters specify the X and Y offset from the upper-left corner of the specified image buffer to the upper-left corner of the pixel-value comparison area. The size of the comparison area is determined by the size of the model.
The Value parameter specifies the pixel value that will be identified in the image buffer to determine the corresponding “don’t care” pixels in the specified model.
See also
MpatCopy, MpatPreprocModel, MpatFindModel, MpatFindMultipleModel
《MpatSetDontCare()函数》上有3条评论
评论已关闭。