Filters
Filter values by
Pattern Matching result buffer
  • Results relating to the entire result buffer
  • Results for a single model
  • Results for all models
| Customize Help
| Save Settings

MpatGetResult



Function Map
Synopsis
Get the specified type of result(s) from a Pattern Matching result buffer.
Syntax
void MpatGetResult(
MIL_ID ResultPatId, //in
MIL_INT Index, //in
MIL_INT64 ResultType, //in
void *ResultArrayPtr //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 MpatFind().

If your target image was associated with a camera 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 camera calibration context but you want to retrieve positional and dimensional results in pixel units, use MpatControl() 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 having specified a calibrated target 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 which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
ResultPatId

Specifies the identifier of the Pattern Matching result buffer from which to retrieve results.

Index

Specifies where to get results. This parameter can be set to one of the following:

function map For specifying where to get results
Click to summarizeValue Description
Click to summarize M_DEFAULT

Same as M_ALL for result types that apply to model occurrences. Same as M_GENERAL for result types that apply to the entire result buffer.

(summarize)
Click to summarize M_ALL

Retrieves the results of the specified type for all model occurrences found.

Click to summarize M_GENERAL

Retrieves a result relating to the entire result buffer.

Click to summarize 0 <= Value < M_NUMBER

Specifies the occurrence index.

ResultType

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

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

ResultArrayPtr
Accepts the address of one of the following (see the Parameter associations section for specifics on which is expected):
  • array of type MIL_DOUBLE [optionally, in C++: a reference to a std::vector<MIL_DOUBLE> ]
  • array of type MIL_ID [optionally, in C++: a reference to a std::vector<MIL_ID> ]
  • array of type MIL_INT [optionally, in C++: a reference to a std::vector<MIL_INT> ]
  • array of type MIL_INT32 [optionally, in C++: a reference to a std::vector<MIL_INT32> ]
  • array of type MIL_INT64 [optionally, in C++: a reference to a std::vector<MIL_INT64> ]
  • MIL_DOUBLE
  • MIL_ID
  • MIL_INT
  • MIL_INT32
  • MIL_INT64

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 M_NUMBER.

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

The tables below list possible values for the ResultType parameter and possible values returned to the ResultArrayPtr parameter.

When retrieving a general result, the ResultType parameter can be set to one of the following values.

function map For general results
Click to summarize
ResultType
Description
ResultArrayPtr
- Possible values returned
Click to summarize M_CONTEXT_ID +

Retrieves the identifier of the Pattern Matching context used by MpatFind() to obtain the results in the result buffer. Note that, if the Pattern Matching context has already been freed, using MpatFree(), the returned Pattern Matching context identifier might no longer be valid.

(summarize)
Expand data type infoCollapse data type info ResultArrayPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Click to summarize M_NUMBER +

Retrieves the number of occurrences found.

(summarize)
Expand data type infoCollapse data type info ResultArrayPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE

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

function map For specifying the results to retrieve
Click to summarize
ResultType
Description
ResultArrayPtr
- Possible values returned
Click to summarize M_ANGLE +

Retrieves the angle of the occurrence (if found using MpatFind()), relative to the output coordinate system specified using MpatControl() 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 26: Calibrating your camera setup.

(summarize)
Expand data type infoCollapse data type info ResultArrayPtr extra info
Data type info: Data type: array of type MIL_DOUBLE [optionally, in C++: a reference to a std::vector<MIL_DOUBLE> ]  |  address of a MIL_DOUBLE MORE
Click to summarize M_INDEX +

Retrieves the index of the model that was found.

(summarize)
Expand data type infoCollapse data type info ResultArrayPtr extra info
Data type info: Data type: array of type MIL_DOUBLE [optionally, in C++: a reference to a std::vector<MIL_DOUBLE> ]  |  address of a MIL_DOUBLE MORE
Click to summarize 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 MpatControl() with M_SAVE_SUMS set to M_ENABLE.

(summarize)
Expand data type infoCollapse data type info ResultArrayPtr extra info
Data type info: Data type: array of type MIL_DOUBLE [optionally, in C++: a reference to a std::vector<MIL_DOUBLE> ]  |  address of a MIL_DOUBLE MORE
Click to summarize M_POSITION_X +

Retrieves the X-coordinate of the occurrence. This is the X-coordinate of the model's reference position transformed at the occurrence (MpatControl() with M_REFERENCE_X).

(summarize)
Expand data type infoCollapse data type info ResultArrayPtr extra info
Data type info: Data type: array of type MIL_DOUBLE [optionally, in C++: a reference to a std::vector<MIL_DOUBLE> ]  |  address of a MIL_DOUBLE MORE
Click to summarize M_POSITION_Y +

Retrieves the Y-coordinate of the occurrence. This is the Y-coordinate of the model's reference position transformed at the occurrence (MpatControl() with M_REFERENCE_Y.

(summarize)
Expand data type infoCollapse data type info ResultArrayPtr extra info
Data type info: Data type: array of type MIL_DOUBLE [optionally, in C++: a reference to a std::vector<MIL_DOUBLE> ]  |  address of a MIL_DOUBLE MORE
Click to summarize M_SCORE +

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

(summarize)
Expand data type infoCollapse data type info ResultArrayPtr extra info
Data type info: Data type: array of type MIL_DOUBLE [optionally, in C++: a reference to a std::vector<MIL_DOUBLE> ]  |  address of a MIL_DOUBLE MORE
Click to summarize 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 MpatControl() with M_SAVE_SUMS set to M_ENABLE.

(summarize)
Expand data type infoCollapse data type info ResultArrayPtr extra info
Data type info: Data type: array of type MIL_DOUBLE [optionally, in C++: a reference to a std::vector<MIL_DOUBLE> ]  |  address of a MIL_DOUBLE MORE
Click to summarize 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 MpatControl() with M_SAVE_SUMS set to M_ENABLE.

(summarize)
Expand data type infoCollapse data type info ResultArrayPtr extra info
Data type info: Data type: array of type MIL_DOUBLE [optionally, in C++: a reference to a std::vector<MIL_DOUBLE> ]  |  address of a MIL_DOUBLE MORE
Click to summarize M_SUM_IM +

Retrieves the sum of the products of the values of the pixels in the image with 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 MpatControl() with M_SAVE_SUMS set to M_ENABLE.

(summarize)
Expand data type infoCollapse data type info ResultArrayPtr extra info
Data type info: Data type: array of type MIL_DOUBLE [optionally, in C++: a reference to a std::vector<MIL_DOUBLE> ]  |  address of a MIL_DOUBLE MORE
Click to summarize 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 MpatControl() with M_SAVE_SUMS set to M_ENABLE.

(summarize)
Expand data type infoCollapse data type info ResultArrayPtr extra info
Data type info: Data type: array of type MIL_DOUBLE [optionally, in C++: a reference to a std::vector<MIL_DOUBLE> ]  |  address of a MIL_DOUBLE MORE
Click to summarize 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 MpatControl() with M_SAVE_SUMS set to M_ENABLE.

(summarize)
Expand data type infoCollapse data type info ResultArrayPtr extra info
Data type info: Data type: array of type MIL_DOUBLE [optionally, in C++: a reference to a std::vector<MIL_DOUBLE> ]  |  address of a MIL_DOUBLE MORE
Combination value for the values listed in For general results; the values listed in For specifying the results to retrieve.

You can add the following value to the above-mentioned values to specify whether a result is available.

function map For determining whether results are available
Click to summarizeResultType Description
ResultArrayPtr
- Possible values returned
Click to summarize M_AVAILABLE +

Retrieves whether a result is available to be returned.

(summarize)
Expand data type infoCollapse data type info ResultArrayPtr extra info
Data type info: Data type: array of type MIL_DOUBLE [optionally, in C++: a reference to a std::vector<MIL_DOUBLE> ]  |  address of a MIL_DOUBLE MORE
Click to summarize M_NULL

Specifies that the result is not available to be retrieved.

Click to summarize Value != 0

Specifies that the result is available to be retrieved.

Combination value for the values listed in For specifying the results to retrieve.

You can add the following value to the above-mentioned values to determine the required array size (number of elements) to store the returned values.

function map For determining the required array size (number of elements) to store the returned values
Click to summarizeResultType combination value Description
ResultArrayPtr
- Possible values returned
Click to summarize M_NB_ELEMENTS

Retrieves the required array size (number of elements) to store the returned values.

(summarize)
Expand data type infoCollapse data type info ResultArrayPtr extra info
Data type info: Data type: address of a MIL_DOUBLE MORE
Combination values for the values listed in For general results; the values listed in For specifying the results to retrieve; and for the following value: M_AVAILABLE.

You can add one of the following values to the above-mentioned values to cast the requested results to the required data type.

Note: In C++, when using a standard vector (std::vector) instead of an array, the values listed in this combination table must not be used. If you need to use a specific data type, instantiate the vector with the necessary data type.

function map For specifying the data type
Click to summarize
ResultType
Description
ResultArrayPtr
- Possible values returned
Click to summarize M_TYPE_MIL_DOUBLE

Casts the requested results to a MIL_DOUBLE.

(summarize)
Expand data type infoCollapse data type info ResultArrayPtr extra info
Data type info: Data type: array of type MIL_DOUBLE [optionally, in C++: a reference to a std::vector<MIL_DOUBLE> ]  |  address of a MIL_DOUBLE MORE
Click to summarize M_TYPE_MIL_ID

Casts the requested results to a MIL_ID.

(summarize)
Expand data type infoCollapse data type info ResultArrayPtr extra info
Data type info: Data type: array of type MIL_ID [optionally, in C++: a reference to a std::vector<MIL_ID> ]  |  address of a MIL_ID MORE
Click to summarize M_TYPE_MIL_INT

Casts the requested results to a MIL_INT.

(summarize)
Expand data type infoCollapse data type info ResultArrayPtr extra info
Data type info: Data type: array of type MIL_INT [optionally, in C++: a reference to a std::vector<MIL_INT> ]  |  address of a MIL_INT MORE
Click to summarize M_TYPE_MIL_INT32

Casts the requested results to a MIL_INT32.

(summarize)
Expand data type infoCollapse data type info ResultArrayPtr extra info
Data type info: Data type: array of type MIL_INT32 [optionally, in C++: a reference to a std::vector<MIL_INT32> ]  |  address of a MIL_INT32 MORE
Click to summarize M_TYPE_MIL_INT64

Casts the requested results to a MIL_INT64.

(summarize)
Expand data type infoCollapse data type info ResultArrayPtr extra info
Data type info: Data type: array of type MIL_INT64 [optionally, in C++: a reference to a std::vector<MIL_INT64> ]  |  address of a MIL_INT64 MORE
Compilation information
Header Include mil.h.
Library Use mil.lib; milpat.lib.
DLL Requires mil.dll; milpat.dll.
DEFAULT ALL GENERAL NUMBER CONTEXT ID NUMBER ANGLE INDEX NUMBER OF PIXELS POSITION X POSITION Y SCORE SUM I SUM II SUM IM SUM M SUM MM AVAILABLE NULL NB ELEMENTS TYPE MIL DOUBLE TYPE MIL ID TYPE MIL INT TYPE MIL INT32 TYPE MIL INT64 GENERAL GENERAL ALL DEFAULT ALL DEFAULT GENERAL ENABLE