MIL_ID ImageBufId, | //in |
const MIL_ID *ModelIdArrayPtr, | //in |
const MIL_ID *PatResultIdArrayPtr, | //in |
MIL_INT NumModels, | //in |
MIL_INT64 SearchMode | //in |
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.
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.
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.
Specifies the address of the one-dimensional array that contains the identifiers of the pattern matching result buffers in which to store results.
Specifies the search mode. This parameter must be set to:
For specifying the search
mode
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
MIL system-specific tooltip (†) |
|||||||||||||||||||||||||||||||||||||
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. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
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]). (more details...) |
† | a | e | f | g | h | i | j | k | l | m | p | q | r |
Header | Include mil.h. |
Library | Use mil.lib; milpat.lib. |
DLL | Requires mil.dll; milpat.dll. |