MpatFindModel()函数

Synopsis

Find a pattern matching model in the target image buffer.

Format

void MpatFindModel(ImageBufId, ModelId, PatResultId)

MIL_ID ImageBufId; Image buffer identifier
MIL_ID ModelId; Model identifier
MIL_ID PatResultId; Pattern matching result buffer identifier

Description

This function finds occurrences of the specified model in the given image and returns the position of each occurrence. The search is performed using the model’s current search parameters. Note, the model search parameters also determine the number of occurrences to find. Results are written to the specified result structure. Use the MpatGet..() commands (MpatGetNumber, MpatGetResult) to read the results.

This function assumes that the model was extracted from an image with the same scaling as the target image. In addition, if using a normalized grayscale non-rotational model, it assumes that there has been no change in image orientation since the model was defined (with a 5° to 10° tolerance). If using a rotational model, the rotational range of the model is established by the MpatSetAngle command.

This function returns results in decreasing match-score order. This means that the most-likely occurrence is always returned first.

Patterns that are very close to the edge of the image may be found with lower match scores than usual due to edge effects. For this reason you should use MpatSetPosition, rather than a child buffer, to restrict the search to a portion of the image.

The ImageBufId parameter specifies the identifier of the source of the target image. This parameter can only be given an image buffer identifier.

The ModelId parameter specifies the identifier of the model for which to search in the specified target image buffer.

The PatResultId parameter specifies the identifier of the pattern recognition result buffer in which to store results.

Status

Current limitations:

  • Only supports unsigned two-dimensional images up to 8 bits deep.

See also

MpatFindMultipleModel, MpatGetNumber, MpatGetResult, MpatPreprocModel, MpatSetAngle