MIL_ID SystemId, | //in |
MIL_ID SrcImageBufId, | //in |
MIL_INT OffX, | //in |
MIL_INT OffY, | //in |
MIL_INT SizeX, | //in |
MIL_INT SizeY, | //in |
MIL_INT64 ModelType, | //in |
MIL_ID *ModelIdPtr | //out |
This function allocates a model, using data from the specified area of the model's source image.
You can change a model's search parameter settings at any time, using the appropriate MpatSet...() function. When the model is no longer required, you should release its memory, using MpatFree().
An M_NORMALIZED type model (without overscan data) is usually used for an image with an inconsistent surrounding region, such as an image of loose nuts and bolts lying on a metal sheet. To perform an angular search, define the angular range in which the model can appear using MpatSetAngle(). When preprocessing an M_NORMALIZED model (without overscan data) for which an angular search range is specified, rotated versions of the model are created assigning "don't care" pixels to regions that do not have corresponding data in the original model.
Angular search is fastest when performed with an M_CIRCULAR_OVERSCAN model; however, M_CIRCULAR_OVERSCAN should only be used when the region around the model is consistent, for example, when searching for a chip in the image of an integrated circuit.
When preprocessing an M_CIRCULAR_OVERSCAN model for which an angular search range has been specified, a set of models is extracted from rotated versions of the M_CIRCULAR_OVERSCAN model, creating models that would appear upright if the target image were rotated. For this type of model, a larger region than the one defined is extracted from the model's source image so as to allow creation of models at different angles.
You can only define models that respect the following condition: (maxvalue 2 * SizeX * SizeY) < 2 63 where maxvalue is the maximum pixel value (typically, 255) in the target image and the model. This restriction is imposed to avoid overflows in the internal 64-bit accumulators.
The total area of the defined model must be greater or equal to 4 pixels (SizeX * SizeY >= 4).
Specifies the system on which to allocate the model.
This parameter should be set to one of the following values:
For specifying the system
identifier
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT_HOST |
Specifies the default Host system of the current MIL application. |
||||||||||||||||||||||||||||||||||||||
MIL system identifier |
Specifies a valid system identifier, previously allocated using MsysAlloc(). |
Specifies the identifier of the image buffer from which to extract the model (that is, the model's source image). This function currently supports only 8-bit unsigned grayscale images.
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 the coordinates of the model origin in the source image (SrcImageBufId). The specified model position (OffX) must be valid in the source image.
Specifies the coordinates of the model origin in the source image (SrcImageBufId). The specified model position (OffY) must be valid in the source image.
Specifies the width of the model. The specified model width (SizeX) must be valid in the source image.
Specifies the height of the model. The specified model height (SizeY) must be valid in the source image.
Specifies the type of the model. This parameter must be set to the following:
For specifying the type of
model
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_NORMALIZED + |
Specifies a model used to search for the position, match score, and angle (if angular search is enabled) of a model occurrence in a target image, using MpatFindModel() and MpatFindMultipleModel(). |
You can add the following value to the above-mentioned value to extract the model, as well as circular overscan data.
For the ModelType parameter
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_CIRCULAR_OVERSCAN |
Specifies that the model is extracted from the source image with the circular overscan data. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; milpat.lib. |
DLL | Requires mil.dll; milpat.dll. |