| MIL 10 Reference
| Customize Help
| Save Settings

MpatGetResult



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
Synopsis
Get the specified type of result(s) from a pattern matching result buffer.
Syntax
void MpatGetResult(
MIL_ID PatResultId, //in
MIL_INT64 ResultType, //in
void *UserArrayPtr //out
)
Description

This function retrieves the result(s) of the specified type from a specified pattern matching result buffer. Results are only available after calling MpatFindModel() or MpatFindMultipleModel().

If your target image was associated with a calibration context, positional and dimensional results are, by default, returned with respect to the relative coordinate system of the image. Otherwise, these results are returned in pixels, relative to the top-left pixel in the target image.

If your target image was associated with a calibration context but you want to retrieve positional and dimensional results in pixel units, use MpatSetSearchParameter() with the M_RESULT_OUTPUT_UNITS control type set to M_PIXEL. However, note that if you set M_RESULT_OUTPUT_UNITS to M_WORLD without specifying a calibrated image in which to calculate the results, MpatGetResult() will generate an error.

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
PatResultId

Specifies the identifier of the pattern matching result buffer from which to retrieve result(s).

ResultType

Specifies the type of result to retrieve for each model occurrence.

See the Parameter associations section for possible values that can be specified.

UserArrayPtr
Accepts the address of one of the following (see the Parameter associations section for specifics on which is expected):
  • array of type MIL_DOUBLE
  • MIL_DOUBLE

Specifies the address of the one-dimensional array in which to write the specified results. The array must be big enough to hold the number of results indicated by MpatGetNumber().

See the Parameter associations section for possible values that can be returned.

The table below lists possible values for the ResultType parameter and possible values returned to the UserArrayPtr parameter.

To specify the type of result to retrieve for each model occurrence, the ResultType parameter must be set to one of the following.

Unless otherwise specified, the following values require that you pass the UserArrayPtr parameter the address of an array of type MIL_DOUBLE with a size equal to the same number of elements returned by MpatGetNumber() (for multiple results) or the address of a MIL_DOUBLE (for a single result).

function map For specifying the results to retrieve
CollapseResultType Description
UserArrayPtr
- Possible values returned
Collapse M_ANGLE

Retrieves the angle of the occurrence (if found using MpatFindModel()), relative to the output coordinate system specified using MpatSetSearchParameter() with M_RESULT_OUTPUT_UNITS.

An angle interpreted with respect to the pixel coordinate system is always measured counter-clockwise. For information on the angle's direction of rotation when interpreting the angle with respect to the relative coordinate system, see the Angle convention in MIL subsection of the Working with real-world units section of Chapter 25: Calibrating your camera setup.

(summarize)
Collapse M_MODEL_INDEX

Retrieves the index of the model, in the model identifier array, for which the occurrence was found when using MpatFindMultipleModel() with M_FIND_BEST_MODELS.

(summarize)
Collapse M_NUMBER_OF_PIXELS

Retrieves the number of pixels in the model used to compute the correlation function.

Note that to retrieve this result type, the sums must be saved using MpatSetSearchParameter() with M_SAVE_SUMS set to M_ENABLE.

(summarize)
Collapse M_POSITION_X

Retrieves the X-coordinate of the occurrence.

(summarize)
Collapse M_POSITION_Y

Retrieves the Y-coordinate of the occurrence.

(summarize)
Collapse M_SCORE

Retrieves the match score of the occurrence, as a percentage.

(summarize)
Collapse M_SUM_I

Retrieves the sum of the values of the pixels in the image over the N pixels corresponding to the model occurrence.

Note that to retrieve this result type, the sums must be saved using MpatSetSearchParameter() with M_SAVE_SUMS set to M_ENABLE.

(summarize)
Collapse M_SUM_II

Retrieves the sum of the squares of the values of the pixels in the image over the N pixels corresponding to the model occurrence.

Note that to retrieve this result type, the sums must be saved using MpatSetSearchParameter() with M_SAVE_SUMS set to M_ENABLE.

(summarize)
Collapse M_SUM_IM

Retrieves the sum of the products of the values of the pixels in the image and the pixels in the model over the N pixels corresponding to the model occurrence.

Note that to retrieve this result type, the sums must be saved using MpatSetSearchParameter() with M_SAVE_SUMS set to M_ENABLE.

(summarize)
Collapse M_SUM_M

Retrieves the sum of the values of the pixels in the model over the N pixels of the model.

Note that to retrieve this result type, the sums must be saved using MpatSetSearchParameter() with M_SAVE_SUMS set to M_ENABLE.

(summarize)
Collapse M_SUM_MM

Retrieves the sum of the squares of the values of the pixels in the model over the N pixels of the model.

Note that to retrieve this result type, the sums must be saved using MpatSetSearchParameter() with M_SAVE_SUMS set to M_ENABLE.

(summarize)
Compilation information
Header Include mil.h.
Library Use mil.lib; milpat.lib.
DLL Requires mil.dll; milpat.dll.
ANGLE MODEL INDEX NUMBER OF PIXELS POSITION X POSITION Y SCORE SUM I SUM II SUM IM SUM M SUM MM ENABLE