| MIL 10 Reference
| Customize Help
| Save Settings

MpatSetPosition



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
Set the search region of a model.
Syntax
void MpatSetPosition(
MIL_ID ModelId, //in
MIL_INT OffX, //in
MIL_INT OffY, //in
MIL_INT SizeX, //in
MIL_INT SizeY //in
)
Description

This function sets the specified model's search region. It limits the area in the target image in which to find the reference position of the model (set with MpatSetCenter()), and consequently increases the search speed. This function is useful when the model's reference position is expected to be found in a certain area. You can change the search region at any time (for example, when tracking an object, the search region could be changed before each call to MpatFindModel() or MpatFindMultipleModel()).

If you have redefined the model's reference position (with MpatSetCenter()), make sure that the search region defined by MpatSetPosition() covers this new reference position and takes into account the angular search range of the model.

Always use this function, rather than a child buffer, to restrict the search region. Other methods result in edge effects, and if the search region is as small as or smaller than the model, other methods produce invalid results.

To change some of the search parameters set with this function without affecting others, specify M_NO_CHANGE for those you do not want to change. For example, you can change OffX and OffY to the required values and keep SizeX and SizeY as is by setting them to M_NO_CHANGE.

To reset the search region size to the full image, set OffX and OffY to zero (0), and SizeX and SizeY to M_ALL.

Note that it is valid to specify a search region (SizeX and SizeY) that is smaller than the search model since you are setting the area in which to find the model's reference position.

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
ModelId

Specifies the identifier of the model for which to change the search region.

OffX INQ

Specifies the X-coordinate of the top-left corner of the search region in the target image.

function map For specifying the X-coordinate of the search region
CollapseValue Description
Collapse M_ALL

Specifies the X-coordinate of the top-left corner of the target image to allow a search of the full image.

This is the default value.

(summarize)
Collapse M_NO_CHANGE

Specifies to keep the previous value of this coordinate as set by MpatSetCenter().

Collapse Value

Specifies the X-coordinate, relative to the pixel coordinate system.

OffY INQ

Specifies the Y-coordinate of the top-left corner of the search region in the target image.

function map For specifying the Y-coordinate of the search region
CollapseValue Description
Collapse M_ALL

Specifies the Y-coordinate of the top-left corner of the target image to allow a search of the full image.

This is the default value.

(summarize)
Collapse M_NO_CHANGE

Specifies to keep the previous value of this coordinate as set by MpatSetCenter().

Collapse Value

Specifies the Y-coordinate, relative to the pixel coordinate system.

SizeX INQ

Specifies the width of the search region.

function map For specifying the width of the search region
CollapseValue Description
Collapse M_ALL

Specifies to use the width of the full image.

This is the default value.

(summarize)
Collapse M_NO_CHANGE

Specifies to keep the previously set value.

Collapse Value

Specifies the width, in pixels.

SizeY INQ

Specifies the height of the search region.

function map For specifying the height of the search region
CollapseValue Description
Collapse M_ALL

Specifies to use the height of the full image.

This is the default value.

(summarize)
Collapse M_NO_CHANGE

Specifies to keep the previously set value.

Collapse Value

Specifies the height, in pixels.

Compilation information
Header Include mil.h.
Library Use mil.lib; milpat.lib.
DLL Requires mil.dll; milpat.dll.
ALL NO CHANGE ALL NO CHANGE ALL NO CHANGE ALL NO CHANGE