Table: | For all strings |
Table: | For retrieving one or more strings |
+ combination: | For retrieving the string length (including the terminating null character). |
+ combination: | For specifying to get the total number of characters for all strings |
Table: | For individual characters |
+ combination: | For determining the required array size (number of elements) to store the returned values |
+ combination: | For specifying the data type |
MIL_ID ResultOcrId, | //in |
MIL_INT64 ResultType, | //in |
void *ResultPtr | //out |
This function retrieves the result(s) of the specified type from an OCR result buffer. The information can be retrieved as a text, a string or a character. A text contains one or more strings. A string contains one or more characters. Results are only available after calling MocrReadString() or MocrVerifyString().
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 MocrControl() 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, MocrGetResult() will generate an error.
Note that, by default, the first string found is returned as a result. To get the result for a specific string or for all strings from a result buffer, use MocrControl() with M_SELECT_STRING.
Specifies the type of result(s) to retrieve. The following values are available to retrieve results from a read or a verify operation, unless otherwise specified.
See the Parameter associations section for possible values that can be specified.
Specifies the address in which to write the results. Each line of text found within the target image is read as a separate string. If there is only one line of text, there is only one string. Only the results from the first string or selected strings (MocrControl() with M_SELECT_STRING) are obtained.
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 ResultPtr parameter.
To retrieve a result for all strings, the ResultType parameter can be set to one of the following:
For all strings
|
|||||||||||||||||||||||||||||||||||||||
ResultType | Description | ||||||||||||||||||||||||||||||||||||||
ResultPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_NB_STRING + |
Retrieves the number of strings read by MocrReadString(). If no strings are found, 0 is returned. (summarize)Retrieves the number of strings read by MocrReadString(). (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info: Data
type: address of a MIL_DOUBLE
MORE
Data type info: Data
type: address of a MIL_DOUBLE
MORE
|
||||||||||||||||||||||||||||||||||||||
M_TEXT + |
Retrieves the entire text. This includes all available strings, their separators, and the terminating null character ("\0"). Note that a string separator is inserted between the different strings when getting all strings simultaneously. The actual string separator can be controlled using MocrControl() with M_TEXT_STRING_SEPARATOR. Refer to M_STRING to retrieve the strings without separators. (summarize)Retrieves the entire text. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
|
||||||||||||||||||||||||||||||||||||||
M_TEXT_SCORE + |
Retrieves the match score for the entire text as determined during the read/verify operation. (summarize)Retrieves the match score for the entire text as determined during the read/verify operation. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info: Data
type: address of a
MIL_DOUBLE
Data type info: Data
type: address of a
MIL_DOUBLE
|
||||||||||||||||||||||||||||||||||||||
M_THRESHOLD + |
Retrieves the value used to binarize the target image. Note that this is available only when using an M_GENERAL OCR font context, or when using an M_CONSTRAINED OCR font context if your target image has multiple lines, or its string angle is not 0.0°. (summarize)Retrieves the value used to binarize the target image. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info: Data
type: address of a
MIL_DOUBLE
Data type info: Data
type: address of a
MIL_DOUBLE
|
The following values are available to retrieve one or more strings, unless otherwise specified. To specify the number of strings to retrieve, use MocrControl() with M_SELECT_STRING. To retrieve a result for a string or all strings, the ResultType parameter can be set to one of the following:
For retrieving one or more strings
|
|||||||||||||||||||||||||||||||||||||||
|
Description | ||||||||||||||||||||||||||||||||||||||
ResultPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_STRING + |
Retrieves the null-terminated string(s) found during the read/verify operation. By default, any unrecognized character in the string will be replaced by the most-likely character, even if the match score for that character is lower than the specified character acceptance level (MocrControl() with M_CHAR_ACCEPTANCE). You can replace all unrecognized characters in the string with an invalid character symbol by calling MocrControl() with M_CHAR_INVALID. Note that no string separator is inserted between the different strings when getting all strings simultaneously. Refer to M_TEXT to retrieve the strings with separators. (summarize)Retrieves the null-terminated string(s) found during the read/verify operation. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info: Data
type: array of type MIL_TEXT_CHAR
MORE
Data type info: Data
type: array of type MIL_TEXT_CHAR
MORE
|
||||||||||||||||||||||||||||||||||||||
M_STRING_ANGLE + |
Retrieves the search angle of the string(s), in degrees, relative to the output coordinate system specified using MocrControl() with M_RESULT_OUTPUT_UNITS. For multiple strings, the search angle of each string is returned. Note that all strings are searched for at the same angle, so all returned values will be equivalent. 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)Retrieves the search angle of the string(s), in degrees, relative to the output coordinate system specified using MocrControl() with M_RESULT_OUTPUT_UNITS. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info: Data
type: address of a MIL_DOUBLE
| array of type MIL_DOUBLE [optionally,
in C++: a reference to a std::vector<MIL_DOUBLE>
] MORE
Data type info: Data
type: address of a MIL_DOUBLE
| array of type MIL_DOUBLE [optionally,
in C++: a reference to a std::vector<MIL_DOUBLE>
] MORE
|
||||||||||||||||||||||||||||||||||||||
M_STRING_CHAR_NUMBER + |
Retrieves the number of characters in the string(s) found during the read/verify operation, not including the terminating null character ("\0") itself; this means it returns the number of characters with results. For multiple strings, the length of each null-terminated string, not including the terminating null character ("\0") itself, is returned. (summarize)Retrieves the number of characters in the string(s) found during the read/verify operation, not including the terminating null character ("\0") itself; this means it returns the number of characters with results. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info: Data
type: address of a MIL_DOUBLE
| array of type MIL_DOUBLE [optionally,
in C++: a reference to a std::vector<MIL_DOUBLE>
] MORE
Data type info: Data
type: address of a MIL_DOUBLE
| array of type MIL_DOUBLE [optionally,
in C++: a reference to a std::vector<MIL_DOUBLE>
] MORE
|
||||||||||||||||||||||||||||||||||||||
M_STRING_SCORE + |
Retrieves the score calculated during the read/verify operation for the entire string(s). For multiple strings, the calculated score for each string is returned. (summarize)Retrieves the score calculated during the read/verify operation for the entire string(s). (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info: Data
type: address of a MIL_DOUBLE
| array of type MIL_DOUBLE [optionally,
in C++: a reference to a std::vector<MIL_DOUBLE>
] MORE
Data type info: Data
type: address of a MIL_DOUBLE
| array of type MIL_DOUBLE [optionally,
in C++: a reference to a std::vector<MIL_DOUBLE>
] MORE
|
||||||||||||||||||||||||||||||||||||||
M_STRING_VALID_FLAG + |
Retrieves the result of the read/verify operation as a flag that denotes the validity of the string(s). The flag's validity status is determined by comparing the string's read score with the string's acceptance level (MocrControl() with M_STRING_ACCEPTANCE). For multiple strings, a validity flag for each string is returned. (summarize)Retrieves the result of the read/verify operation as a flag that denotes the validity of the string(s). (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info: Data
type: address of a MIL_DOUBLE
| array of type MIL_DOUBLE [optionally,
in C++: a reference to a std::vector<MIL_DOUBLE>
] MORE
Data type info: Data
type: address of a MIL_DOUBLE
| array of type MIL_DOUBLE [optionally,
in C++: a reference to a std::vector<MIL_DOUBLE>
] MORE
|
||||||||||||||||||||||||||||||||||||||
M_FALSE |
Specifies that the string's score is below the string acceptance level. |
||||||||||||||||||||||||||||||||||||||
M_TRUE |
Specifies that the string's score is above the string acceptance level. |
You can add the following value to the above-mentioned values to get the string length (including the terminating null character).
For retrieving the string length (including the
terminating null character).
|
|||||||||||||||||||||||||||||||||||||||
ResultType | Description | ||||||||||||||||||||||||||||||||||||||
ResultPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_STRING_SIZE + |
Retrieves the length of one or more strings, including the terminating null character ("\0"). In the case of M_TEXT, it also includes string separators. This combination constant is useful to establish the required array size to retrieve the string. (summarize)Retrieves the length of one or more strings, including the terminating null character ("\0"). (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info: Data
type: address of a MIL_DOUBLE
MORE
Data type info: Data
type: address of a MIL_DOUBLE
MORE
|
You can add the following value to the above-mentioned values to specify whether to get the total number of characters for all strings, instead of one value per string.
For specifying to get the total number of characters
for all strings
|
|||||||||||||||||||||||||||||||||||||||
|
Description | ||||||||||||||||||||||||||||||||||||||
ResultPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_SUM |
Specifies to return the total number of characters for all strings, instead of one value per string. Note that the terminating null character ("\0") is ignored by this combination constant. Note that this value cannot be combined with M_TEXT. (summarize)Specifies to return the total number of characters for all strings, instead of one value per string. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info: Data
type: address of a MIL_DOUBLE
MORE
Data type info: Data
type: address of a MIL_DOUBLE
MORE
|
The following values are available to retrieve the results for individual characters in one or more strings, unless otherwise specified. To specify the number of strings to retrieve, use MocrControl() with M_SELECT_STRING. To retrieve a result for the individual characters of one or more strings, the ResultType parameter can be set to one of the following:
For individual characters
|
|||||||||||||||||||||||||||||||||||||||
|
Description | ||||||||||||||||||||||||||||||||||||||
ResultPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_CHAR_POSITION_X + |
Retrieves the X-position of each individual character in the string or strings. (summarize)Retrieves the X-position of each individual character in the string or strings. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info: Data
type: array of type MIL_DOUBLE [optionally, in C++:
a reference to a std::vector<MIL_DOUBLE>
] MORE
Data type info: Data
type: array of type MIL_DOUBLE [optionally, in C++:
a reference to a std::vector<MIL_DOUBLE>
] MORE
|
||||||||||||||||||||||||||||||||||||||
M_CHAR_POSITION_Y + |
Retrieves the Y-position of each individual character in the string or strings. (summarize)Retrieves the Y-position of each individual character in the string or strings. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info: Data
type: array of type MIL_DOUBLE [optionally, in C++:
a reference to a std::vector<MIL_DOUBLE>
] MORE
Data type info: Data
type: array of type MIL_DOUBLE [optionally, in C++:
a reference to a std::vector<MIL_DOUBLE>
] MORE
|
||||||||||||||||||||||||||||||||||||||
M_CHAR_SCORE + |
Retrieves the match score of each individual character within the string or strings. (summarize)Retrieves the match score of each individual character within the string or strings. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info: Data
type: array of type MIL_DOUBLE [optionally, in C++:
a reference to a std::vector<MIL_DOUBLE>
] MORE
Data type info: Data
type: array of type MIL_DOUBLE [optionally, in C++:
a reference to a std::vector<MIL_DOUBLE>
] MORE
|
||||||||||||||||||||||||||||||||||||||
M_CHAR_SIZE_X + |
Retrieves the cell width of each character within the string or strings. (summarize)Retrieves the cell width of each character within the string or strings. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info: Data
type: array of type MIL_DOUBLE [optionally, in C++:
a reference to a std::vector<MIL_DOUBLE>
] MORE
Data type info: Data
type: array of type MIL_DOUBLE [optionally, in C++:
a reference to a std::vector<MIL_DOUBLE>
] MORE
|
||||||||||||||||||||||||||||||||||||||
M_CHAR_SIZE_Y + |
Retrieves the cell height of each character within the string or strings. (summarize)Retrieves the cell height of each character within the string or strings. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info: Data
type: array of type MIL_DOUBLE [optionally, in C++:
a reference to a std::vector<MIL_DOUBLE>
] MORE
Data type info: Data
type: array of type MIL_DOUBLE [optionally, in C++:
a reference to a std::vector<MIL_DOUBLE>
] MORE
|
||||||||||||||||||||||||||||||||||||||
M_CHAR_SPACING + |
Retrieves the spacing between each pair of characters in the selected string,or strings. Note that the spacing of the last character in each string is M_NULL. (summarize)Retrieves the spacing between each pair of characters in the selected string,or strings. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info: Data
type: array of type MIL_DOUBLE [optionally, in C++:
a reference to a std::vector<MIL_DOUBLE>
] MORE
Data type info: Data
type: array of type MIL_DOUBLE [optionally, in C++:
a reference to a std::vector<MIL_DOUBLE>
] MORE
|
||||||||||||||||||||||||||||||||||||||
M_CHAR_VALID_FLAG + |
Retrieves the result of the read/verify operation as flags that denote the validity of each character within the string or strings. Each flag's validity status is determined by comparing the character's read score with the character's acceptance level (MocrControl() with M_CHAR_ACCEPTANCE). (summarize)Retrieves the result of the read/verify operation as flags that denote the validity of each character within the string or strings. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info:
Data type: array of type
MIL_DOUBLE [optionally, in C++: a reference to a std::vector<MIL_DOUBLE>
] MORE
Data type info:
Data type: array of type
MIL_DOUBLE [optionally, in C++: a reference to a std::vector<MIL_DOUBLE>
] MORE
|
||||||||||||||||||||||||||||||||||||||
M_FALSE |
Specifies that the character's score is below the character acceptance level. |
||||||||||||||||||||||||||||||||||||||
M_TRUE |
Specifies that the character's score is above the character acceptance level. |
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.
For determining the required array size (number of
elements) to store the returned values
|
|||||||||||||||||||||||||||||||||||||||
ResultType combination value | Description | ||||||||||||||||||||||||||||||||||||||
ResultPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_NB_ELEMENTS |
Retrieves the required array size (number of elements) to store the returned values. (summarize)Retrieves the required array size (number of elements) to store the returned values. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info:
Data type: address of a
MIL_DOUBLE MORE
Data type info:
Data type: address of a
MIL_DOUBLE MORE
|
You can add one of the following values to the above-mentioned values to cast the requested results to a 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.
For specifying the data type
|
|||||||||||||||||||||||||||||||||||||||
ResultType | Description | ||||||||||||||||||||||||||||||||||||||
ResultPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_DOUBLE |
Casts the requested results to a MIL_DOUBLE. (summarize)Casts the requested results to a MIL_DOUBLE. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr 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
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
|
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_FLOAT |
Casts the requested results to a MIL_FLOAT. (summarize)Casts the requested results to a MIL_FLOAT. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info:
Data type: array of type
MIL_FLOAT [optionally, in C++: a reference to a std::vector<MIL_FLOAT>
] | address of a
MIL_FLOAT MORE
Data type info:
Data type: array of type
MIL_FLOAT [optionally, in C++: a reference to a std::vector<MIL_FLOAT>
] | address of a
MIL_FLOAT MORE
|
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_INT |
Casts the requested results to a MIL_INT. (summarize)Casts the requested results to a MIL_INT. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr 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
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
|
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_INT16 |
Casts the requested results to a MIL_INT16. (summarize)Casts the requested results to a MIL_INT16. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info:
Data type: array of type
MIL_INT16 [optionally, in C++: a reference to a std::vector<MIL_INT16>
] | address of a
MIL_INT16 MORE
Data type info:
Data type: array of type
MIL_INT16 [optionally, in C++: a reference to a std::vector<MIL_INT16>
] | address of a
MIL_INT16 MORE
|
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_INT32 |
Casts the requested results to a MIL_INT32. (summarize)Casts the requested results to a MIL_INT32. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr 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
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
|
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_INT64 |
Casts the requested results to a MIL_INT64. (summarize)Casts the requested results to a MIL_INT64. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr 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
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
|
||||||||||||||||||||||||||||||||||||||
M_TYPE_TEXT_CHAR |
Cast the requested results to a MIL_TEXT_CHAR. (summarize)Cast the requested results to a MIL_TEXT_CHAR. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr extra info |
Data type info:
Data type: address of a
MIL_TEXT_CHAR | array of
type MIL_TEXT_CHAR MORE
Data type info:
Data type: address of a
MIL_TEXT_CHAR | array of
type MIL_TEXT_CHAR MORE
|
Header | Include mil.h. |
Library | Use mil.lib; milocr.lib. |
DLL | Requires mil.dll; milocr.dll. |