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 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 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:
Unless otherwise specified, the following values require that you pass the ResultPtr parameter the address of a MIL_DOUBLE.
For all strings
|
|||||||||||||||||||||||||||||||||||||||
ResultType |
Description
|
||||||||||||||||||||||||||||||||||||||
ResultPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_TEXT + |
Retrieves the entire text. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr data type info |
Data
type: array of type MIL_TEXT_CHAR |
||||||||||||||||||||||||||||||||||||||
M_TEXT_LENGTH + |
Retrieves the total number of characters in the entire text. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_TEXT_SCORE + |
Retrieves the match score for the entire text as determined during the read/verify operation. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_THRESHOLD + |
Retrieves the value used to binarize the target image. (more details...) |
The following values are available to retrieve results from a read or a verify operation, unless otherwise specified. To retrieve a result for a string or all strings, the ResultType parameter can be set to one of the following:
Unless otherwise specified, the following values require that you pass the ResultPtr parameter the address of a MIL_DOUBLE (for a single string) or the address of an array of type MIL_DOUBLE with a size equal to M_NB_STRING (for multiple strings).
For retrieving results from a read or
verify operation
|
|||||||||||||||||||||||||||||||||||||||
ResultType |
Description
|
||||||||||||||||||||||||||||||||||||||
ResultPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_NB_STRING + |
Retrieves the number of strings read by MocrReadString(). (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr data type info |
Data
type: MIL_DOUBLE |
||||||||||||||||||||||||||||||||||||||
M_STRING + |
Retrieves the null-terminated string found during the read/verify operation. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr data type info |
|
||||||||||||||||||||||||||||||||||||||
M_STRING_ALLOC_SIZE + |
Retrieves the total size of the string, including the terminating null character ("\0"). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_STRING_ANGLE + |
Retrieves the search angle of the string, in degrees, relative to the output coordinate system specified using MocrControl() with M_RESULT_OUTPUT_UNITS. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_STRING_SCORE + |
Retrieves the score calculated during the read/verify operation for the entire string. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_STRING_SIZE + |
Retrieves the length of the null-terminated string found during the read/verify operation, not including the terminating null character ("\0") itself. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_STRING_VALID_FLAG + |
Retrieves the result of the read/verify operation as a flag that denotes the validity of the string. (more details...) |
||||||||||||||||||||||||||||||||||||||
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 value to get the total length of all available strings.
For M_STRING_SIZE
|
|||||||||||||||||||||||||||||||||||||||
ResultType |
Description
|
||||||||||||||||||||||||||||||||||||||
ResultPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_SUM |
Retrieves the total length of all available strings without the NULL terminating character or string separators. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr data type info |
Data
type: MIL_DOUBLE |
To retrieve a result for individual characters, the ResultType parameter can be set to one of the following:
Unless otherwise specified, for a single string, the following values require that you pass the ResultPtr parameter the address of an array of type MIL_DOUBLE with a size equal to M_STRING_SIZE. For multiple strings, the following values require that you pass the ResultPtr parameter the address of an array of type MIL_DOUBLE with a size equal to M_STRING_SIZE + M_SUM.
For individual characters
|
|||||||||||||||||||||||||||||||||||||||
ResultType |
Description
|
||||||||||||||||||||||||||||||||||||||
ResultPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_CHAR_POSITION_X + |
Retrieves the X-position of each individual character in the string, or strings. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CHAR_POSITION_Y + |
Retrieves the Y-position of each individual character in the string, or strings. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CHAR_SCORE + |
Retrieves the match score of each individual character within the string, or strings. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CHAR_SIZE_X + |
Retrieves the cell width of each character within the string, or strings. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CHAR_SIZE_Y + |
Retrieves the cell height of each character within the string, or strings. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CHAR_SPACING + |
Retrieves the spacing between each pair of characters in the selected string, or strings. (more details...) |
||||||||||||||||||||||||||||||||||||||
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. (more details...) |
||||||||||||||||||||||||||||||||||||||
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 one of the following values to the above-mentioned values to cast the requested results to a required data type.
For specifying the data type
|
|||||||||||||||||||||||||||||||||||||||
ResultType |
Description
|
||||||||||||||||||||||||||||||||||||||
ResultPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_TYPE_CHAR |
Casts the requested results to a char. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr data type info |
Data
type: char |
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_DOUBLE |
Casts the requested results to a MIL_DOUBLE. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr data type info |
|
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_FLOAT |
Casts the requested results to a MIL_FLOAT. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr data type info |
Data
type: MIL_FLOAT |
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_INT |
Casts the requested results to a MIL_INT. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr data type info |
Data
type: MIL_INT |
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_INT16 |
Casts the requested results to a MIL_INT16. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr data type info |
Data
type: MIL_INT16 |
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_INT32 |
Casts the requested results to a MIL_INT32. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr data type info |
Data
type: MIL_INT32 |
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_INT64 |
Casts the requested results to a MIL_INT64. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr data type info |
Data
type: MIL_INT64 |
||||||||||||||||||||||||||||||||||||||
M_TYPE_TEXT_CHAR |
Cast the requested results to a MIL_TEXT_CHAR. (more details...) |
||||||||||||||||||||||||||||||||||||||
ResultPtr data type info |
|
Header | Include mil.h. |
Library | Use mil.lib; milocr.lib. |
DLL | Requires mil.dll; milocr.dll. |