MIL_ID ResultId, | //in |
MIL_INT ResultIndex, | //in |
MIL_INT64 ResultType, | //in |
void *ResultArrayPtr | //out |
This function retrieves the result(s) of the specified type from a Model Finder result buffer. Results are only available after calling MmodFind().
The result entries will be ordered by match score, starting with the highest score (regardless of the result type requested). When searching for multiple models, results are not sorted according to which model occurrence was found; results are still sorted according to score. The M_INDEX result type returns the index of the model associated with the Model Finder result; whereas the M_USER_LABEL result type returns its user label.
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 MmodControl() 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, MmodGetResult() will generate an error.
If the target is not calibrated and the nominal search aspect ratio is not set to 1 (MmodControl() with M_ASPECT_RATIO), results are returned for the corrected target coordinate system (whereby the target pixel width is equal to the pixel height).
Specifies where to get results. This parameter can be set to one of the following:
For specifying where to get
results
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_ALL for result types that apply to one or all occurrences. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ALL |
Retrieves the results of the specified type for all model occurrences found. |
||||||||||||||||||||||||||||||||||||||
M_GENERAL |
Retrieves a result relating to the entire Model Finder context. |
||||||||||||||||||||||||||||||||||||||
0 <= Value < M_NUMBER |
Specifies the result index. |
Specifies the type of result to retrieve.
See the Parameter associations section for possible values that can be specified.
Specifies the address in which to write results.
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.
Unless otherwise specified, the following values require that you pass the ResultArrayPtr parameter the address of a MIL_DOUBLE.
For general results
|
|||||||||||||||||||||||||||||||||||||||
ResultType |
Description
|
||||||||||||||||||||||||||||||||||||||
ResultArrayPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_CONTEXT_ID + |
Retrieves the identifier of the Model Finder context used by MmodFind() to obtain the results in the result buffer. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_MOD_DEFINE_COMPATIBLE + |
Retrieves whether the result can be used to define a model. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_FALSE |
Specifies that the result cannot be used to define a model. |
||||||||||||||||||||||||||||||||||||||
M_TRUE |
Specifies that the result can be used to define a model. |
||||||||||||||||||||||||||||||||||||||
M_NUMBER + |
Retrieves the number of occurrences found (all models). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_TIMEOUT_END + |
Retrieves whether the timeout has been reached. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_FALSE |
Specifies that the timeout has not been reached. |
||||||||||||||||||||||||||||||||||||||
M_TRUE |
Specifies that the timeout has been reached. |
When retrieving a general result, a result for an individual occurrence, or a result for all occurrences (M_ALL), the ResultType parameter can be set to the following value.
Unless otherwise specified, the following values require that you pass the ResultArrayPtr parameter the address of a MIL_DOUBLE (when retrieving an individual occurrence or a general result) or the address of an array of type MIL_DOUBLE with a size equal to the number of occurrences found; this number can be obtained using MmodGetResult() with M_NUMBER (when retrieving all results).
For an individual occurrence or a general
result
|
|||||||||||||||||||||||||||||||||||||||
ResultType |
Description
|
||||||||||||||||||||||||||||||||||||||
ResultArrayPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_NUMBER_OF_CHAINED_EDGELS + |
Retrieves the total number of chained edgels. (more details...) |
When retrieving a general result or result(s) for a single occurrence, the ResultType parameter can be set to one of the following values.
When retrieving a general result, the following values are not supported if the Model Finder context is an M_GEOMETRIC_CONTROLLED type of context.
Unless otherwise specified, the following values require that you pass the ResultArrayPtr parameter the address of an array of type MIL_DOUBLE with a size equal to the number of chained edgels. This number can be obtained using MmodGetResult() with M_NUMBER_OF_CHAINED_EDGELS .
For a general result for a single
occurrence
|
|||||||||||||||||||||||||||||||||||||||
ResultType |
Description
|
||||||||||||||||||||||||||||||||||||||
ResultArrayPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_CHAIN_ANGLE + |
Retrieves the angle values of each edgel in all chains in the entire target or in the model occurrence. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CHAIN_INDEX + |
Retrieves the chain index of each edgel in all chains in the entire target, or in the model occurrence. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CHAIN_X + |
Retrieves the X-coordinate of each edgel in all chains in the entire target or in the model occurrence. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CHAIN_Y + |
Retrieves the Y-coordinate of each edgel in all chains in the entire target or in the model occurrence. (more details...) |
You can add one of the following values to the above-mentioned values to specify the edges for which to retrieve results.
For specifying which edges in the
occurrence to consider
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_MODEL |
Retrieves the edge information of the model transformed at the occurrence position. |
||||||||||||||||||||||||||||||||||||||
M_TARGET |
Retrieves the edge information of the target in the region of the occurrence. (more details...) |
When retrieving a result for a single occurrence or for all occurrences, the ResultType parameter can be set to one of the following values.
Unless otherwise specified, the following values require that you pass the ResultArrayPtr parameter the address of a MIL_DOUBLE (when retrieving an individual occurrence) or the address of an array of type MIL_DOUBLE with a size equal to the number of occurrences found; this number can be obtained using MmodGetResult() with M_NUMBER (when retrieving all results).
For a result for a single occurrence or
all occurrences
|
|||||||||||||||||||||||||||||||||||||||
ResultType |
Description
|
||||||||||||||||||||||||||||||||||||||
ResultArrayPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_ANGLE + |
Retrieves the angle of the occurrence's reference axis (specified for the model using MmodControl() with M_REFERENCE_ANGLE), relative to the output coordinate system specified using MmodControl() with M_RESULT_OUTPUT_UNITS. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ASPECT_RATIO + |
Retrieves the found aspect ratio of all occurrences. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CENTER_X + |
Retrieves the X-coordinate of the center of an occurrence of a circle model. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CENTER_Y + |
Retrieves the Y-coordinate of the center of an occurrence of a circle model. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_FIT_ERROR + |
Retrieves the fit error as the average quadratic distance, in pixels or calibrated units, between the edges in the occurrence and the corresponding edges in the model. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_INDEX + |
Retrieves the index of the model that was found. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_MODEL_COVERAGE + |
Retrieves the model coverage of the occurrence. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_POLARITY + |
Retrieves the polarity of the occurrence. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ANY |
Specifies that the occurrences are a mixture of polarities. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_REVERSE |
Specifies that the polarity of occurrences is the reverse of that of the model. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SAME |
Specifies that the polarity of occurrences is the same as that of the model. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_POSITION_X + |
Retrieves the X-coordinate of the occurrence. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_POSITION_Y + |
Retrieves the Y-coordinate of the occurrence. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SCALE + |
Retrieves the scale of the occurrence. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SCORE + |
Retrieves the score of the occurrence (as a percentage). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SCORE_TARGET + |
Retrieves the target score of the occurrence. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_TARGET_COVERAGE + |
Retrieves the target coverage of the model. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_USER_LABEL + |
Retrieves the user label of the model that was found. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NO_LABEL |
Specifies that no user label is associated with the model. |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the user label of the model. INFO |
When retrieving a result for a single occurrence or for all occurrences, the ResultType parameter can be set to one of the following values. The following values are not available for all model types. For one of these values to be available for a result occurrence, the result occurrence must be of the appropriate type. Use M_AVAILABLE to ensure that the value can be used with the occurrence. If the ResultIndex parameter is set to M_ALL, all the occurrences must support the result type, otherwise an error is generated.
Unless otherwise specified, the following values require that you pass the ResultArrayPtr parameter the address of a MIL_DOUBLE (when retrieving an individual occurrence) or the address of an array of type MIL_DOUBLE with a size equal to the number of occurrences found; this number can be obtained using MmodGetResult() with M_NUMBER (when retrieving all results).
For a result for a single occurrence or
all occurrences (with constraints)
|
|||||||||||||||||||||||||||||||||||||||
ResultType |
Description
|
||||||||||||||||||||||||||||||||||||||
ResultArrayPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_CORNER_RADIUS + |
Retrieves the radius used to round the corners of the models. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_HEIGHT + |
Retrieves the height of the shape. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_HORIZONTAL_THICKNESS + |
Retrieves the horizontal thickness of the cross. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_INNER_RADIUS + |
Retrieves the inner radius of the ring. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_OUTER_RADIUS + |
Retrieves the outer radius of the ring. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_RADIUS + |
Retrieves the radius of the circle. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_VERTICAL_THICKNESS + |
Retrieves the vertical thickness of the cross. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_WIDTH + |
Retrieves the width of the shape. (more details...) |
To retrieve a transformation coefficient for a single occurrence or for all occurrences, the ResultType parameter can be set to one of the following values. These coefficients allow you to convert coordinates in the model coordinate system to the corresponding coordinates in the target coordinate system for that occurrence (or vice versa). These coefficients handle variations in scale, translation, and angle. If the model is calibrated, these coefficients are given for the real world.
Use the following equations:
x d = A x s + B y s + C .
y d = -B x s + A y s + D .
where A, B, C, and D are the transformation coefficients (forward or reverse); x s and y s specify the source coordinates (with respect to the origin of the model coordinate system for a forward transformation or target coordinate system for a reverse transformation); and, x d and y d are the destination coordinates (with respect to the origin of the target coordinate system for a forward transformation or model coordinate system for a reverse transformation).
Unless otherwise specified, the following values require that you pass the ResultArrayPtr parameter the address of a MIL_DOUBLE (when retrieving an individual occurrence) or the address of an array of type MIL_DOUBLE with a size equal to the number of occurrences found; this number can be obtained using MmodGetResult() with M_NUMBER (when retrieving all results).
For retrieving a transformation
coefficient
|
|||||||||||||||||||||||||||||||||||||||
ResultType |
Description
|
||||||||||||||||||||||||||||||||||||||
ResultArrayPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_A_FORWARD + |
Retrieves the forward transformation coefficient A for the occurrence. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_A_REVERSE + |
Retrieves the reverse transformation coefficient A for the occurrence. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_B_FORWARD + |
Retrieves the forward transformation coefficient B for the occurrence. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_B_REVERSE + |
Retrieves the reverse transformation coefficient B for the occurrence. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_C_FORWARD + |
Retrieves the forward transformation coefficient C for the occurrence. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_C_REVERSE + |
Retrieves the reverse transformation coefficient C for the occurrence. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_D_FORWARD + |
Retrieves the forward transformation coefficient D for the occurrence. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_D_REVERSE + |
Retrieves the reverse transformation coefficient D for the occurrence. (more details...) |
You can add the following value to the above-mentioned values to specify whether a result is available.
For determining whether results are
available
|
|||||||||||||||||||||||||||||||||||||||
ResultType |
Description
|
||||||||||||||||||||||||||||||||||||||
ResultArrayPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_AVAILABLE |
Retrieves whether a result is available to be returned. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultArrayPtr data type info |
Data
type: MIL_DOUBLE |
||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies that the result is not available to be retrieved. |
||||||||||||||||||||||||||||||||||||||
Value != 0 |
Specifies that the result is available to be retrieved. |
You can add one of the following values to the above-mentioned values to cast the requested results to the required data type.
For specifying the data
type
|
|||||||||||||||||||||||||||||||||||||||
ResultType |
Description
|
||||||||||||||||||||||||||||||||||||||
ResultArrayPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_DOUBLE |
Casts the requested results to a MIL_DOUBLE. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultArrayPtr data type info |
|
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_ID |
Casts the requested results to a MIL_ID. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultArrayPtr data type info |
|
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_INT |
Casts the requested results to a MIL_INT. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultArrayPtr data type info |
|
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_INT32 |
Casts the requested results to a MIL_INT32. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultArrayPtr data type info |
|
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_INT64 |
Casts the requested results to a MIL_INT64. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultArrayPtr data type info |
|
Header | Include mil.h. |
Library | Use mil.lib; milmod.lib. |
DLL | Requires mil.dll; milmod.dll. |