MIL_ID ModelId, | //in |
MIL_INT OffX, | //in |
MIL_INT OffY, | //in |
MIL_INT SizeX, | //in |
MIL_INT SizeY | //in |
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.
Specifies the X-coordinate of the top-left corner of the search region in the target image.
For specifying the X-coordinate of the
search region
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_ALL |
Specifies the X-coordinate of the top-left corner of the target image to allow a search of the full image. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NO_CHANGE |
Specifies to keep the previous value of this coordinate as set by MpatSetCenter(). |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the X-coordinate, relative to the pixel coordinate system. |
Specifies the Y-coordinate of the top-left corner of the search region in the target image.
For specifying the Y-coordinate of the
search region
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_ALL |
Specifies the Y-coordinate of the top-left corner of the target image to allow a search of the full image. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NO_CHANGE |
Specifies to keep the previous value of this coordinate as set by MpatSetCenter(). |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the Y-coordinate, relative to the pixel coordinate system. |
Specifies the width of the search region.
For specifying the width of the search
region
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_ALL |
Specifies to use the width of the full image. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NO_CHANGE |
Specifies to keep the previously set value. |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the width, in pixels. |
Specifies the height of the search region.
For specifying the height of the search
region
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_ALL |
Specifies to use the height of the full image. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NO_CHANGE |
Specifies to keep the previously set value. |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the height, in pixels. |
Header | Include mil.h. |
Library | Use mil.lib; milpat.lib. |
DLL | Requires mil.dll; milpat.dll. |