MIL_ID FontContextOrResultOcrId, | //in |
MIL_INT64 InquireType, | //in |
void *UserVarPtr | //out |
This function inquires about an OCR font context or an OCR result buffer setting.
Note that for an OCR result buffer, this function only retrieves information about result buffer settings (set with MocrControl(), for example). To retrieve results from the OCR result buffer, use MocrGetResult().
Specifies the identifier of the OCR font context or the OCR result buffer from which to read information.
Specifies the type of setting about which to inquire.
See the Parameter associations section for possible values that can be specified.
Specifies the address in which to write the requested information. Since this function also returns the requested information, you can set this parameter to M_NULL.
See the Parameter associations section for possible values that can be returned.
The tables below list possible values for the InquireType parameter and possible values returned to the UserVarPtr parameter.
For an OCR font context, the InquireType parameter can be set to one of the following:
Unless otherwise specified, the following values require that you pass the UserVarPtr parameter the address of a MIL_DOUBLE.
For OCR settings
|
|||||||||||||||||||||||||||||||||||||||
InquireType |
Description
|
||||||||||||||||||||||||||||||||||||||
UserVarPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_BLANK_CHARACTERS + |
Inquires whether the space between characters in the target image is read. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DISABLE |
Specifies that blank spaces will not be read from the target image into the result string. INFO |
||||||||||||||||||||||||||||||||||||||
M_ENABLE |
Specifies that blank spaces will be read from the target image into the result string. |
||||||||||||||||||||||||||||||||||||||
M_BROKEN_CHAR + |
Inquires the capacity to read/verify broken characters. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DISABLE |
Specifies that, during the read/verify, OCR should not try to compensate for broken characters. INFO |
||||||||||||||||||||||||||||||||||||||
M_ENABLE |
Specifies that broken characters should be identifies as possible characters. |
||||||||||||||||||||||||||||||||||||||
M_CHAR_ACCEPTANCE + |
Inquires the acceptance level used to determine a successful match between the font and the characters found within the target image. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
0.0 <= Value <= 100.0 |
Specifies the acceptance level for a target character. |
||||||||||||||||||||||||||||||||||||||
M_CHAR_CELL_SIZE_X + |
Inquires the font's character cell width. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
6 <= Value <= 256 |
Specifies the width, in pixels. |
||||||||||||||||||||||||||||||||||||||
M_CHAR_CELL_SIZE_Y + |
Inquires the font's character cell height. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
6 <= Value <= 256 |
Specifies the height, in pixels. |
||||||||||||||||||||||||||||||||||||||
M_CHAR_IN_FONT + |
Inquires a list of the ASCII characters associated with the character representations present in the font. SET SET (more details...) |
||||||||||||||||||||||||||||||||||||||
UserVarPtr data type info |
Data
type: array of type char |
||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies that the parameter is ignored. |
||||||||||||||||||||||||||||||||||||||
"StringOfCharacters" |
Specifies the string with the list of ASCII characters. |
||||||||||||||||||||||||||||||||||||||
M_CHAR_INVALID + |
Inquires the symbol for the unrecognized characters within the string, or strings. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies that no special character will replace unrecognized characters. |
||||||||||||||||||||||||||||||||||||||
1 <= Value <= 255 |
Specifies the character that will replace unrecognized characters. |
||||||||||||||||||||||||||||||||||||||
M_CHAR_NUMBER + |
Inquires the number of characters that can be stored in the font of the OCR font context. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the number of characters. |
||||||||||||||||||||||||||||||||||||||
M_CHAR_NUMBER_IN_FONT + |
Inquires the number of characters that are actually stored in the OCR font context. (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the number of characters. |
||||||||||||||||||||||||||||||||||||||
M_CHAR_OFFSET_X + |
Inquires the font's character offset along the X-axis. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the offset along the X-axis, in pixels. |
||||||||||||||||||||||||||||||||||||||
M_CHAR_OFFSET_Y + |
Inquires the font's character offset along the Y-axis. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the offset along the Y-axis, in pixels. |
||||||||||||||||||||||||||||||||||||||
M_CHAR_POSITION_VARIATION_X + |
Inquires the amount by which the position of the characters in the target image can vary along the X-axis. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
0.0 <= Value <= 100.0 |
Specifies the position tolerance, in pixels of the character, not of the target image. |
||||||||||||||||||||||||||||||||||||||
M_CHAR_POSITION_VARIATION_Y + |
Inquires the amount by which the position of the characters in the target image can vary along the Y-axis. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
0.0 <= Value <= 100.0 |
Specifies the position tolerance, in pixels of the character, not of the target image. |
||||||||||||||||||||||||||||||||||||||
M_CHAR_SIZE_X + |
Inquires the width of the font's characters. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
6 <= Value <= 256 |
Specifies the width, in pixels. INFO |
||||||||||||||||||||||||||||||||||||||
M_CHAR_SIZE_Y + |
Inquires the height of the font's characters. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
6 <= Value <= 256 |
Specifies the height, in pixels. INFO |
||||||||||||||||||||||||||||||||||||||
M_CHAR_THICKNESS + |
Inquires the average thickness of the font's characters. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the average thickness, in pixels. |
||||||||||||||||||||||||||||||||||||||
M_CONSTRAINT + n + |
Inquires the constraint string for the n th position in the read/verified null-terminated string. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
UserVarPtr data type info |
Data
type: array of type char |
||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies that there is no constraint. |
||||||||||||||||||||||||||||||||||||||
"StringOfCharacters" |
Specifies the string with the list of ASCII characters. |
||||||||||||||||||||||||||||||||||||||
M_CONSTRAINT_TYPE + n + |
Inquires the constraint type for the n th character in the string, as set by MocrSetConstraint(). SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_ANY. |
||||||||||||||||||||||||||||||||||||||
M_ANY |
Specifies that all characters present in the font are valid. |
||||||||||||||||||||||||||||||||||||||
M_DIGIT |
Specifies that only characters "0" to "9" (ASCII codes 48 to 57) are valid. |
||||||||||||||||||||||||||||||||||||||
M_LETTER + |
Specifies that only characters "A" to "Z" and "a" to "z" (ASCII codes 65 to 90 and 97 to 122) are valid. |
||||||||||||||||||||||||||||||||||||||
M_CONTEXT + |
Inquires the type of the OCR font context. SET SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CONSTRAINED |
Specifies an OCR font context that works well with degraded target images. INFO |
||||||||||||||||||||||||||||||||||||||
M_GENERAL |
Specifies an OCR font context that works well with clean target images. INFO |
||||||||||||||||||||||||||||||||||||||
M_EXTRA_CHARACTERS + |
Inquires whether the string is still identified and read when the image contains more characters than otherwise expected. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DISABLE |
Specifies that the read/verify operation should not try to compensate for extra characters. |
||||||||||||||||||||||||||||||||||||||
M_ENABLE |
Specifies that the read/verify operation should try to compensate for extra characters. |
||||||||||||||||||||||||||||||||||||||
M_FONT_INIT_FLAG + |
Inquires the initialization flag passed at font allocation. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_FOREGROUND_BLACK |
Specifies that the characters to read or verify are darker than the background. |
||||||||||||||||||||||||||||||||||||||
M_FOREGROUND_WHITE |
Specifies that the characters to read or verify are brighter than the background. |
||||||||||||||||||||||||||||||||||||||
M_FONT_TYPE + |
Inquires the font type of the OCR font context. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SEMI_M12_92 |
Specifies a font respecting the SEMI M12-92 standard as the type of font. INFO |
||||||||||||||||||||||||||||||||||||||
M_SEMI_M13_88 |
Specifies a font respecting the SEMI M13-88 standard as the type of font. INFO |
||||||||||||||||||||||||||||||||||||||
M_USER_DEFINED + |
Specifies a general, user-defined type of font. INFO (more details...) |
||||||||||||||||||||||||||||||||||||||
M_FOREGROUND_VALUE + |
Inquires the foreground value of the font. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_FOREGROUND_BLACK |
Specifies that the characters to read or verify are darker than the background. |
||||||||||||||||||||||||||||||||||||||
M_FOREGROUND_WHITE |
Specifies that the characters to read or verify are brighter than the background. |
||||||||||||||||||||||||||||||||||||||
M_MORPHOLOGIC_FILTERING + |
Inquires the number of iterations of morphological filtering. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
0 <= Value <= 100 |
Specifies the number of iterations. INFO |
||||||||||||||||||||||||||||||||||||||
M_PREPROCESSED + |
Inquires whether preprocessing is necessary. (more details...) |
||||||||||||||||||||||||||||||||||||||
0 |
Specifies that preprocessing is necessary. |
||||||||||||||||||||||||||||||||||||||
Value > 0 |
Specifies that preprocessing is not necessary. |
||||||||||||||||||||||||||||||||||||||
M_SKIP_STRING_LOCATION + |
Inquires whether the string location step will be skipped or not. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DISABLE |
Specifies that the step will not be skipped. |
||||||||||||||||||||||||||||||||||||||
M_ENABLE |
Specifies that the step will be skipped. |
||||||||||||||||||||||||||||||||||||||
M_SPEED + |
Inquires the algorithm's search speed. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_HIGH |
Specifies a high speed. |
||||||||||||||||||||||||||||||||||||||
M_LOW |
Specifies a low speed. |
||||||||||||||||||||||||||||||||||||||
M_MEDIUM |
Specifies a medium speed. |
||||||||||||||||||||||||||||||||||||||
M_VERY_HIGH |
Specifies a very high speed. |
||||||||||||||||||||||||||||||||||||||
M_VERY_LOW |
Specifies a very low speed. |
||||||||||||||||||||||||||||||||||||||
M_STRING_ACCEPTANCE + |
Inquires the acceptance level used to determine a successful match between the font and the read/verified string. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
0.0 <= Value <= 100.0 |
Specifies the acceptance level for a string. |
||||||||||||||||||||||||||||||||||||||
M_STRING_ANGLE + |
Inquires the angle at which the string is expected to be found. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ACCORDING_TO_REGION |
Specifies to use the angle of the rectangular ROI (set using MbufSetRegion()) associated with the target image buffer. INFO |
||||||||||||||||||||||||||||||||||||||
0 <= Value <= 360 |
Specifies the angle, in degrees. |
||||||||||||||||||||||||||||||||||||||
M_STRING_ANGLE_DELTA_NEG + |
Inquires the possible angle variation in a clockwise rotation, relative to M_STRING_ANGLE. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
0 <= Value <= 180 |
Specifies the possible clockwise angle variation, in degrees. INFO |
||||||||||||||||||||||||||||||||||||||
M_STRING_ANGLE_DELTA_POS + |
Inquires the possible angle variation in a counter-clockwise rotation, relative to M_STRING_ANGLE. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
0 <= Value <= 180 |
Specifies the possible counter-clockwise angle variation, in degrees. INFO |
||||||||||||||||||||||||||||||||||||||
M_STRING_ANGLE_INTERPOLATION_MODE + |
Inquires the interpolation mode to use when reading/verifying a string at an angle. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_BICUBIC |
Specifies that bicubic interpolation should be used. |
||||||||||||||||||||||||||||||||||||||
M_BILINEAR |
Specifies that bilinear interpolation should be used. |
||||||||||||||||||||||||||||||||||||||
M_NEAREST_NEIGHBOR |
Specifies that nearest neighbor interpolation should be used. |
||||||||||||||||||||||||||||||||||||||
M_STRING_NUMBER + |
Inquires the number of strings to read from the target image. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ALL |
Specifies that the number of strings in the target image should be determined automatically. |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the number of lines of text in the target image. INFO |
||||||||||||||||||||||||||||||||||||||
M_STRING_SIZE + |
Inquires the expected length of the string within the target image. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ANY |
Specifies that the length of the string is unknown. INFO |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the string length to read/verify, which must be less than or equal to the maximum string length of the OCR font context. INFO |
||||||||||||||||||||||||||||||||||||||
M_STRING_SIZE_MAX + |
Inquires the maximum string length that will be read/verified using the OCR font context. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the maximum string length. |
||||||||||||||||||||||||||||||||||||||
M_TARGET_CHAR_SIZE_X + |
Inquires the width of the expected target characters. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SAME |
Specifies that the character width is found automatically. INFO |
||||||||||||||||||||||||||||||||||||||
Value > 1 |
Specifies the character width in pixels (with subpixel accuracy). INFO |
||||||||||||||||||||||||||||||||||||||
M_TARGET_CHAR_SIZE_Y + |
Inquires the height of the expected target characters. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SAME |
Specifies that the character height is found automatically. INFO |
||||||||||||||||||||||||||||||||||||||
Value > 1 |
Specifies the character height in pixels (with subpixel accuracy). INFO |
||||||||||||||||||||||||||||||||||||||
M_TARGET_CHAR_SPACING + |
Inquires the expected amount of space between characters in the string. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ANY |
Specifies that the inter-character spacing is unknown and not the same between the characters. INFO |
||||||||||||||||||||||||||||||||||||||
M_SAME |
Specifies that the inter-character spacing is the same throughout the target string. INFO |
||||||||||||||||||||||||||||||||||||||
Value >= 2 |
Specifies the inter-character spacing, in pixels, with subpixel accuracy. INFO |
||||||||||||||||||||||||||||||||||||||
M_TEXT_STRING_SEPARATOR + |
Inquires the ASCII code of the character to be used as a string separator within the text read. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the ASCII code of the character. |
||||||||||||||||||||||||||||||||||||||
M_THICKEN_CHAR + |
Inquires the number of times a character should be thickened. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
0 <= Value <= 100 |
Specifies the number of times a character should be thickened. INFO |
||||||||||||||||||||||||||||||||||||||
M_THRESHOLD + |
Inquires the threshold value used to internally binarize the target image. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_AUTO |
Specifies an automatically computed threshold value. |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the threshold value. |
||||||||||||||||||||||||||||||||||||||
M_TOUCHING_CHAR + |
Inquires whether the capability to read characters that touch is enabled or not. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DISABLE |
Specifies to disable the identification of touching characters. INFO |
||||||||||||||||||||||||||||||||||||||
M_ENABLE |
Specifies to enable the identification of touching characters. |
One of the following values might be combined with the above-mentioned value to determine the letter case for the constraint.
Returns the letter case for the
constraint
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_LOWERCASE |
Specifies that only characters "a" to "z" (ASCII codes 97 to 122) are valid. |
||||||||||||||||||||||||||||||||||||||
M_UPPERCASE |
Specifies that only characters "A" to "Z" (ASCII codes 65 to 90) are valid. |
One of the following values is combined with the above-mentioned value to determine the OCR font context type.
Returns the context type
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_CONSTRAINED |
Specifies an OCR font context that works well with degraded target images and requires more information about the target string, but provides a more robust search. INFO |
||||||||||||||||||||||||||||||||||||||
M_GENERAL |
Specifies an OCR font context that works well with clean target images. INFO |
You can add the following value to the above-mentioned value to specify that the returned string is sorted in ascending ASCII order.
For M_CHAR_IN_FONT
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_SORT |
Sorts the returned string in ascending ASCII order. |
For an OCR result buffer, the InquireType parameter can be set to one of the following:
Unless otherwise specified, the following values require that you pass the UserVarPtr parameter the address of a MIL_DOUBLE.
For specifying the result for
MocrGetResult()
|
|||||||||||||||||||||||||||||||||||||||
InquireType |
Description
|
||||||||||||||||||||||||||||||||||||||
UserVarPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_RESULT_OUTPUT_UNITS + |
Inquires whether results are returned in pixel or world units. SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ACCORDING_TO_CALIBRATION |
Specifies that results are returned in world units if the result was calculated on an image associated with a calibration context; otherwise, specifies that results are returned in pixel units. |
||||||||||||||||||||||||||||||||||||||
M_PIXEL |
Specifies that results are returned in pixel units, with respect to the pixel coordinate system. |
||||||||||||||||||||||||||||||||||||||
M_WORLD |
Specifies that results are returned in world units, with respect to the relative coordinate system. INFO |
||||||||||||||||||||||||||||||||||||||
M_SELECT_STRING + |
Inquires the index of the string, selected from a multiple line text, for which to get the results with MocrGetResult(). SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ALL |
Specifies that all strings are selected. |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies a specific string. INFO |
To inquire about the system on which the OCR font context or result buffer is allocated, set the InquireType parameter to the value below.
Unless otherwise specified, the following values require that you pass the UserVarPtr parameter the address of a MIL_DOUBLE.
For inquiring about the
system
|
|||||||||||||||||||||||||||||||||||||||
InquireType |
Description
|
||||||||||||||||||||||||||||||||||||||
UserVarPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_OWNER_SYSTEM + |
Inquires the identifier of the system on which the OCR font context or result buffer is allocated. SET SET (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT_HOST |
Specifies the default Host system of the current MIL application. |
||||||||||||||||||||||||||||||||||||||
MIL system identifier |
Specifies a valid system identifier, previously allocated using MsysAlloc(). |
You can add one of the following values to the above-mentioned values to cast the requested information to the required data type.
For specifying the data type
|
|||||||||||||||||||||||||||||||||||||||
InquireType |
Description
|
||||||||||||||||||||||||||||||||||||||
UserVarPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_TYPE_CHAR |
Casts the requested information to a char. (more details...) |
||||||||||||||||||||||||||||||||||||||
UserVarPtr data type info |
Data
type: char |
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_DOUBLE |
Casts the requested information to a MIL_DOUBLE. (more details...) |
||||||||||||||||||||||||||||||||||||||
UserVarPtr data type info |
Data
type: MIL_DOUBLE |
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_FLOAT |
Casts the requested information to a MIL_FLOAT. (more details...) |
||||||||||||||||||||||||||||||||||||||
UserVarPtr data type info |
Data
type: MIL_FLOAT |
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_ID |
Casts the requested information to a MIL_ID. (more details...) |
||||||||||||||||||||||||||||||||||||||
UserVarPtr data type info |
Data
type: MIL_ID |
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_INT |
Casts the requested information to a MIL_INT. (more details...) |
||||||||||||||||||||||||||||||||||||||
UserVarPtr data type info |
Data
type: MIL_INT |
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_INT16 |
Casts the requested results to a MIL_INT16. (more details...) |
||||||||||||||||||||||||||||||||||||||
UserVarPtr data type info |
Data
type: MIL_INT16 |
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_INT32 |
Casts the requested information to a MIL_INT32. (more details...) |
||||||||||||||||||||||||||||||||||||||
UserVarPtr data type info |
Data
type: MIL_INT32 |
||||||||||||||||||||||||||||||||||||||
M_TYPE_MIL_INT64 |
Casts the requested information to a MIL_INT64. (more details...) |
||||||||||||||||||||||||||||||||||||||
UserVarPtr data type info |
Data
type: MIL_INT64 |
||||||||||||||||||||||||||||||||||||||
M_TYPE_TEXT_CHAR |
Casts the requested information to a MIL_TEXT_CHAR. (more details...) |
||||||||||||||||||||||||||||||||||||||
UserVarPtr data type info |
|
Header | Include mil.h. |
Library | Use mil.lib; milocr.lib. |
DLL | Requires mil.dll; milocr.dll. |