| MIL 10 Reference
| Customize Help
| Save Settings

MpatFindMultipleModel



See also
Availability
Not available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Partially supported on:
Partially supported on Matrox CronosPlus
Partially supported on Matrox GPU processing driver
Partially supported on Matrox GigE Vision driver
Partially supported on Matrox USB3 Vision driver (requires Update 19)
Partially supported on Matrox Vio

Fully supported on:
Fully supported on Host system
Fully supported on Matrox IEEE 1394 IIDC driver
Fully supported on Matrox Iris GT
Fully supported on Matrox Morphis
Fully supported on Matrox Morphis QxT
Fully supported on Matrox Orion HD
Fully supported on Matrox Radient eCL
Fully supported on Matrox Radient eV-CXP
Fully supported on Matrox Solios eA/XA
Fully supported on Matrox Solios ecl/xcl/ev-cl

For any information regarding a MIL system added during a MIL Update, see the MIL system’s release note

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
None.
Synopsis
Find multiple pattern matching models in the target image buffer.
Syntax
void MpatFindMultipleModel(
MIL_ID ImageBufId, //in
const MIL_ID *ModelIdArrayPtr, //in
const MIL_ID *PatResultIdArrayPtr, //in
MIL_INT NumModels, //in
MIL_INT64 SearchMode //in
)
Description

This function finds occurrences of the specified models in the given image and returns the position of each occurrence for each model or of the best matches from the group of models. If you want to search for several models in a given image region, a single call to this function is more efficient than multiple calls to MpatFindModel(). This function assumes all models have been preprocessed, and requires that all models be of the same size.

You can limit the operation to a region of the image buffer, using a rectangular region of interest (ROI) set using MbufSetRegion(). Doing so will cause an increase in processing time, but it is more flexible than setting a search region using MpatSetPosition() because it allows a search at an angle and it is possible to define your search region in world units.

This function assumes that each 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 the model's source image and the target image are at the same orientation (with approximately 5° tolerance). For an angular search, use MpatSetAngle() to set the angular search range of the model.

Results are written to the specified result buffers. This function returns results in decreasing match-score order. This means that the most-likely occurrence is always returned first. Use the MpatGet...() functions to read the results. See MpatAllocResult() for more information on allocating result buffers.

Patterns that are very close to the edge of the image might be found with lower match scores than usual due to edge effects. For this reason, you should use an ROI set using MbufSetRegion() or a search region set using MpatSetPosition(), rather than a child buffer, to restrict the search to a portion of the image.

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
ImageBufId

Specifies the identifier of the target image buffer. Note that this function only supports 8-bit unsigned grayscale images.

This image buffer can only have a rectangular region of interest (ROI) defined (with or without rotation). Besides defining the region in which to search, the angle of the ROI is used as the nominal search angle. In addition, the region must be defined in vector format from a graphics list (M_VECTOR or M_VECTOR_AND_RASTER). An error will be generated if the ROI is only in raster format (M_RASTER) or a non-rectangular shape. An error will be generated if M_SEARCH_ANGLE is set to a value other than 0.0 when the image buffer has an ROI.

ModelIdArrayPtr

Specifies the address of the one-dimensional array that contains the identifiers of the models for which to search in the specified target image buffer. Note, all models must be of the same size and must use the same search region in the target image.

PatResultIdArrayPtr

Specifies the address of the one-dimensional array that contains the identifiers of the pattern matching result buffers in which to store results.

NumModels

Specifies the number of models.

SearchMode

Specifies the search mode. This parameter must be set to:

function map For specifying the search mode
CollapseValue Description
MIL system-specific
tooltip (†)
Collapse M_FIND_ALL_MODELS

Searches for all the specified models in the target image and writes the result of each model search in the corresponding buffer. The search is performed using each model's current search parameters. Each model's search parameters also determine the maximum number of occurrences for which to look in the target image (MpatSetNumber()). If a correlation has a match score greater than or equal to the model's certainty level (MpatSetCertainty()), it is automatically considered an occurrence (default 80%), the remaining occurrences will be the best of those greater than or equal to the acceptance level (MpatSetAcceptance()). Note, the results for the model in the ModelIdArrayPtr [n] are written in the corresponding result buffer PatResultIdArrayPtr [n]. Therefore, you must specify the same number of result buffers as the number of models.

(summarize)
a b c d e f g h i j k l m n o p q r s
Collapse M_FIND_BEST_MODELS

Searches for the specified models in the target image and writes the results which have the highest match scores in a single result buffer (PatResultIdArrayPtr [0]). Note that the number of different matches that are found depends on MpatSetNumber(), MpatSetCertainty(), and MpatSetAcceptance() of the first model in the array but cannot exceed 100 occurrences. The certainty, speed and all other search parameters are also specified by the first model in the array; the search parameter settings of the other models are ignored. The model index of the model that generated the best match scores can be read from the result buffer by setting the MpatGetResult() ResultType parameter to M_MODEL_INDEX.

You cannot use M_FIND_BEST_MODELS to perform an angular search (MpatSetAngle()).

(summarize)
a e f g h i j k l m p q r
Compilation information
Header Include mil.h.
Library Use mil.lib; milpat.lib.
DLL Requires mil.dll; milpat.dll.
UNSIGNED PROC RASTER FIND ALL MODELS FIND BEST MODELS