| MIL 10 Reference
| Customize Help
| Save Settings

MpatAllocRotatedModel



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

Available on Windows
Available on Linux

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
Rotate a pattern matching model.
Syntax
MIL_ID MpatAllocRotatedModel(
MIL_ID SystemId, //in
MIL_ID SrcModelId, //in
MIL_DOUBLE Angle, //in
MIL_INT64 InterpolationMode, //in
MIL_INT64 ModelType, //in
MIL_ID *NewModelIdPtr //out
)
Description

This function allocates a new model and initializes it with the rotated version of the specified source model.

This function has the same effect as creating an M_NORMALIZED model (without M_CIRCULAR_OVERSCAN) for which a single angle is specified (that is, delta minimum and maximum are set to 0).

Note that the allocated model size is usually greater than the size of its source, due to the rectangular shape of the model and the nature of the rotation operation. The additional pixel locations produced by the rotation, which have no corresponding pixels in the source model, are set to "don't care" values. The size (X and Y) of the new model can be inquired, using MpatInquire().

Note that the settings of the source model are copied to the new model. You can change any of the model's search parameters (using any appropriate MpatSet...() function), except its angle (MpatSetAngle() function).

Once you have a rotated version of a model, if you no longer require the original source model, it can be deleted with MpatFree().

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 if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
SystemId

Specifies the system on which to allocate the rotated model.

This parameter should be set to one of the values in the following table.

function map For specifying the system identifier
CollapseValue Description
Collapse M_DEFAULT_HOST

Specifies the default Host system of the current MIL application.

Collapse MIL system identifier

Specifies a valid system identifier, previously allocated using MsysAlloc().

SrcModelId

Specifies the identifier of the source model. It must be an M_NORMALIZED model without overscan data. A new rotated model is generated from this model.

Angle

Specifies the angle at which to rotate the model in a counter-clockwise direction. This parameter can be set to any value from 0° to 360°.

InterpolationMode

Specifies the mode of interpolation. This parameter must be set to one of the values below.

function map For specifying interpolation mode
CollapseValue Description
Collapse M_DEFAULT

Same as M_NEAREST_NEIGHBOR.

Collapse M_BICUBIC

Specifies bicubic interpolation.

Collapse M_BILINEAR

Specifies bilinear interpolation.

Collapse M_NEAREST_NEIGHBOR

Specifies nearest neighbor interpolation.

ModelType

Specifies the type of the new model. This parameter must be set to the value below.

function map For specifying the type of model
CollapseValue Description
Collapse M_NORMALIZED

Searches for the position and match score of a model occurrence in a target image, using MpatFindModel() and MpatFindMultipleModel().

NewModelIdPtr

Specifies the address of the variable in which to write the rotated model identifier. Since the MpatAllocRotatedModel() function also returns the model identifier, you can set this parameter to M_NULL.

Return value
The returned value is the model identifier if the allocation is successful. If allocation fails, M_NULL is returned.
Compilation information
Header Include mil.h.
Library Use mil.lib; milpat.lib.
DLL Requires mil.dll; milpat.dll.
DEFAULT HOST NORMALIZED DEFAULT BICUBIC BILINEAR NEAREST NEIGHBOR NORMALIZED