| MIL 10 Reference
| Customize Help
| Save Settings

MocrInquire



See also
Availability
Not available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
None.
Synopsis
Inquire about OCR font context or an OCR result buffer setting.
Syntax
MIL_INT MocrInquire(
MIL_ID FontContextOrResultOcrId, //in
MIL_INT64 InquireType, //in
void *UserVarPtr //out
)
Description

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().

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 if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
FontContextOrResultOcrId

Specifies the identifier of the OCR font context or the OCR result buffer from which to read information.

InquireType

Specifies the type of setting about which to inquire.

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

UserVarPtr
Accepts the address of one of the following (see the Parameter associations section for specifics on which is expected):
  • array of type char
  • array of type MIL_TEXT_CHAR
  • char
  • MIL_DOUBLE
  • MIL_FLOAT
  • MIL_ID
  • MIL_INT
  • MIL_INT16
  • MIL_INT32
  • MIL_INT64
  • MIL_TEXT_CHAR

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.

function map For OCR settings
CollapseInquireType Description
UserVarPtr
- Possible values returned
Collapse M_BLANK_CHARACTERS +

Inquires whether the space between characters in the target image is read. Note that this is available only when using an M_GENERAL OCR font context. SET

(summarize)
Collapse M_DISABLE

Specifies that blank spaces will not be read from the target image into the result string. INFO

Collapse M_ENABLE

Specifies that blank spaces will be read from the target image into the result string.

Collapse M_BROKEN_CHAR +

Inquires the capacity to read/verify broken characters. SET

(summarize)
Collapse M_DISABLE

Specifies that, during the read/verify, OCR should not try to compensate for broken characters. INFO

Collapse M_ENABLE

Specifies that broken characters should be identifies as possible characters.

Collapse 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

(summarize)
Collapse 0.0 <= Value <= 100.0

Specifies the acceptance level for a target character.

Collapse M_CHAR_CELL_SIZE_X +

Inquires the font's character cell width. SET

(summarize)
Collapse 6 <= Value <= 256

Specifies the width, in pixels.

Collapse M_CHAR_CELL_SIZE_Y +

Inquires the font's character cell height. SET

(summarize)
Collapse 6 <= Value <= 256

Specifies the height, in pixels.

Collapse M_CHAR_IN_FONT +

Inquires a list of the ASCII characters associated with the character representations present in the font. SET SET

(summarize)
Collapse UserVarPtr data type info

Data type: array of type char
Array size: M_CHAR_NUMBER_IN_FONT +1.

Collapse M_NULL

Specifies that the parameter is ignored.

Collapse "StringOfCharacters"

Specifies the string with the list of ASCII characters.

Collapse M_CHAR_INVALID +

Inquires the symbol for the unrecognized characters within the string, or strings. SET

(summarize)
Collapse M_NULL

Specifies that no special character will replace unrecognized characters.

Collapse 1 <= Value <= 255

Specifies the character that will replace unrecognized characters.

Collapse M_CHAR_NUMBER +

Inquires the number of characters that can be stored in the font of the OCR font context. SET

(summarize)
Collapse Value

Specifies the number of characters.

Collapse M_CHAR_NUMBER_IN_FONT +

Inquires the number of characters that are actually stored in the OCR font context.

(summarize)
Collapse Value

Specifies the number of characters.

Collapse M_CHAR_OFFSET_X +

Inquires the font's character offset along the X-axis. SET

(summarize)
Collapse Value

Specifies the offset along the X-axis, in pixels.

Collapse M_CHAR_OFFSET_Y +

Inquires the font's character offset along the Y-axis. SET

(summarize)
Collapse Value

Specifies the offset along the Y-axis, in pixels.

Collapse 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. This value is expressed in pixels of the character, not of the target image. SET

(summarize)
Collapse 0.0 <= Value <= 100.0

Specifies the position tolerance, in pixels of the character, not of the target image.

Collapse 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. This value is expressed in pixels of the character, not of the target image. SET

(summarize)
Collapse 0.0 <= Value <= 100.0

Specifies the position tolerance, in pixels of the character, not of the target image.

Collapse M_CHAR_SIZE_X +

Inquires the width of the font's characters. SET

(summarize)
Collapse 6 <= Value <= 256

Specifies the width, in pixels. INFO

Collapse M_CHAR_SIZE_Y +

Inquires the height of the font's characters. SET

(summarize)
Collapse 6 <= Value <= 256

Specifies the height, in pixels. INFO

Collapse M_CHAR_THICKNESS +

Inquires the average thickness of the font's characters. SET

(summarize)
Collapse Value

Specifies the average thickness, in pixels.

Collapse M_CONSTRAINT + n +

Inquires the constraint string for the n th position in the read/verified null-terminated string. SET

(summarize)
Collapse UserVarPtr data type info

Data type: array of type char
Array size: The array must be large enough to hold the value(s) of the specified parameter.

Collapse M_NULL

Specifies that there is no constraint.

Collapse "StringOfCharacters"

Specifies the string with the list of ASCII characters.

Collapse M_CONSTRAINT_TYPE + n +

Inquires the constraint type for the n th character in the string, as set by MocrSetConstraint(). SET

(summarize)
Collapse M_DEFAULT

Same as M_ANY.

Collapse M_ANY

Specifies that all characters present in the font are valid.

Collapse M_DIGIT

Specifies that only characters "0" to "9" (ASCII codes 48 to 57) are valid.

Collapse M_LETTER +

Specifies that only characters "A" to "Z" and "a" to "z" (ASCII codes 65 to 90 and 97 to 122) are valid.

Collapse M_CONTEXT +

Inquires the type of the OCR font context. SET SET

(summarize)
Collapse M_CONSTRAINED

Specifies an OCR font context that works well with degraded target images. INFO

Collapse M_GENERAL

Specifies an OCR font context that works well with clean target images. INFO

Collapse M_EXTRA_CHARACTERS +

Inquires whether the string is still identified and read when the image contains more characters than otherwise expected. SET

(summarize)
Collapse M_DISABLE

Specifies that the read/verify operation should not try to compensate for extra characters.

Collapse M_ENABLE

Specifies that the read/verify operation should try to compensate for extra characters.

Collapse M_FONT_INIT_FLAG +

Inquires the initialization flag passed at font allocation. SET

(summarize)
Collapse M_FOREGROUND_BLACK

Specifies that the characters to read or verify are darker than the background.

Collapse M_FOREGROUND_WHITE

Specifies that the characters to read or verify are brighter than the background.

Collapse M_FONT_TYPE +

Inquires the font type of the OCR font context. SET

(summarize)
Collapse M_SEMI_M12_92

Specifies a font respecting the SEMI M12-92 standard as the type of font. INFO

Collapse M_SEMI_M13_88

Specifies a font respecting the SEMI M13-88 standard as the type of font. INFO

Collapse M_USER_DEFINED +

Specifies a general, user-defined type of font. INFO


This value is combined with a value from the following table:
(summarize)
Collapse M_FOREGROUND_VALUE +

Inquires the foreground value of the font. SET

(summarize)
Collapse M_FOREGROUND_BLACK

Specifies that the characters to read or verify are darker than the background.

Collapse M_FOREGROUND_WHITE

Specifies that the characters to read or verify are brighter than the background.

Collapse M_MORPHOLOGIC_FILTERING +

Inquires the number of iterations of morphological filtering. SET

(summarize)
Collapse 0 <= Value <= 100

Specifies the number of iterations. INFO

Collapse M_PREPROCESSED +

Inquires whether preprocessing is necessary. The font context must be preprocessed (using MocrPreprocess()) before calling MocrReadString() or MocrVerifyString(). After some of the target constraints or font-specific controls are changed, this inquire type will indicate that the context is no longer in its preprocessed state.

(summarize)
Collapse 0

Specifies that preprocessing is necessary.

Collapse Value > 0

Specifies that preprocessing is not necessary.

Collapse M_SKIP_STRING_LOCATION +

Inquires whether the string location step will be skipped or not. SET

(summarize)
Collapse M_DISABLE

Specifies that the step will not be skipped.

Collapse M_ENABLE

Specifies that the step will be skipped.

Collapse M_SPEED +

Inquires the algorithm's search speed. SET

(summarize)
Collapse M_HIGH

Specifies a high speed.

Collapse M_LOW

Specifies a low speed.

Collapse M_MEDIUM

Specifies a medium speed.

Collapse M_VERY_HIGH

Specifies a very high speed.

Collapse M_VERY_LOW

Specifies a very low speed.

Collapse M_STRING_ACCEPTANCE +

Inquires the acceptance level used to determine a successful match between the font and the read/verified string. SET

(summarize)
Collapse 0.0 <= Value <= 100.0

Specifies the acceptance level for a string.

Collapse M_STRING_ANGLE +

Inquires the angle at which the string is expected to be found. SET

(summarize)
Collapse M_ACCORDING_TO_REGION

Specifies to use the angle of the rectangular ROI (set using MbufSetRegion()) associated with the target image buffer. INFO

Collapse 0 <= Value <= 360

Specifies the angle, in degrees.

Collapse M_STRING_ANGLE_DELTA_NEG +

Inquires the possible angle variation in a clockwise rotation, relative to M_STRING_ANGLE. SET

(summarize)
Collapse 0 <= Value <= 180

Specifies the possible clockwise angle variation, in degrees. INFO

Collapse M_STRING_ANGLE_DELTA_POS +

Inquires the possible angle variation in a counter-clockwise rotation, relative to M_STRING_ANGLE. SET

(summarize)
Collapse 0 <= Value <= 180

Specifies the possible counter-clockwise angle variation, in degrees. INFO

Collapse M_STRING_ANGLE_INTERPOLATION_MODE +

Inquires the interpolation mode to use when reading/verifying a string at an angle. SET

(summarize)
Collapse M_BICUBIC

Specifies that bicubic interpolation should be used.

Collapse M_BILINEAR

Specifies that bilinear interpolation should be used.

Collapse M_NEAREST_NEIGHBOR

Specifies that nearest neighbor interpolation should be used.

Collapse M_STRING_NUMBER +

Inquires the number of strings to read from the target image. SET

(summarize)
Collapse M_ALL

Specifies that the number of strings in the target image should be determined automatically.

Collapse Value

Specifies the number of lines of text in the target image. INFO

Collapse M_STRING_SIZE +

Inquires the expected length of the string within the target image. SET

(summarize)
Collapse M_ANY

Specifies that the length of the string is unknown. INFO

Collapse 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

Collapse M_STRING_SIZE_MAX +

Inquires the maximum string length that will be read/verified using the OCR font context. SET

(summarize)
Collapse Value

Specifies the maximum string length.

Collapse M_TARGET_CHAR_SIZE_X +

Inquires the width of the expected target characters. SET

(summarize)
Collapse M_SAME

Specifies that the character width is found automatically. INFO

Collapse Value > 1

Specifies the character width in pixels (with subpixel accuracy). INFO

Collapse M_TARGET_CHAR_SIZE_Y +

Inquires the height of the expected target characters. SET

(summarize)
Collapse M_SAME

Specifies that the character height is found automatically. INFO

Collapse Value > 1

Specifies the character height in pixels (with subpixel accuracy). INFO

Collapse M_TARGET_CHAR_SPACING +

Inquires the expected amount of space between characters in the string. SET

(summarize)
Collapse M_ANY

Specifies that the inter-character spacing is unknown and not the same between the characters. INFO

Collapse M_SAME

Specifies that the inter-character spacing is the same throughout the target string. INFO

Collapse Value >= 2

Specifies the inter-character spacing, in pixels, with subpixel accuracy. INFO

Collapse M_TEXT_STRING_SEPARATOR +

Inquires the ASCII code of the character to be used as a string separator within the text read. SET

(summarize)
Collapse Value

Specifies the ASCII code of the character.

Collapse M_THICKEN_CHAR +

Inquires the number of times a character should be thickened. SET

(summarize)
Collapse 0 <= Value <= 100

Specifies the number of times a character should be thickened. INFO

Collapse M_THRESHOLD +

Inquires the threshold value used to internally binarize the target image. SET

(summarize)
Collapse M_AUTO

Specifies an automatically computed threshold value.

Collapse Value

Specifies the threshold value.

Collapse M_TOUCHING_CHAR +

Inquires whether the capability to read characters that touch is enabled or not. SET

(summarize)
Collapse M_DISABLE

Specifies to disable the identification of touching characters. INFO

Collapse M_ENABLE

Specifies to enable the identification of touching characters.

Combination constants for M_LETTER (when InquireType=M_CONSTRAINT_TYPE + n and UserVarPtr=M_LETTER).

One of the following values might be combined with the above-mentioned value to determine the letter case for the constraint.

function map Returns the letter case for the constraint
CollapseCombination value Description
Collapse M_LOWERCASE

Specifies that only characters "a" to "z" (ASCII codes 97 to 122) are valid.

Collapse M_UPPERCASE

Specifies that only characters "A" to "Z" (ASCII codes 65 to 90) are valid.

Combination constants for M_USER_DEFINED (when InquireType=M_FONT_TYPE and UserVarPtr=M_USER_DEFINED).

One of the following values is combined with the above-mentioned value to determine the OCR font context type.

function map Returns the context type
CollapseCombination value Description
Collapse 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

Collapse M_GENERAL

Specifies an OCR font context that works well with clean target images. INFO

Combination constant for M_CHAR_IN_FONT.

You can add the following value to the above-mentioned value to specify that the returned string is sorted in ascending ASCII order.

function map For M_CHAR_IN_FONT
CollapseCombination value Description
Collapse 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.

function map For specifying the result for MocrGetResult()
CollapseInquireType Description
UserVarPtr
- Possible values returned
Collapse M_RESULT_OUTPUT_UNITS +

Inquires whether results are returned in pixel or world units. SET

(summarize)
Collapse 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.

Collapse M_PIXEL

Specifies that results are returned in pixel units, with respect to the pixel coordinate system.

Collapse M_WORLD

Specifies that results are returned in world units, with respect to the relative coordinate system. INFO

Collapse M_SELECT_STRING +

Inquires the index of the string, selected from a multiple line text, for which to get the results with MocrGetResult(). SET

(summarize)
Collapse M_ALL

Specifies that all strings are selected.

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

function map For inquiring about the system
CollapseInquireType Description
UserVarPtr
- Possible values returned
Collapse M_OWNER_SYSTEM +

Inquires the identifier of the system on which the OCR font context or result buffer is allocated. SET SET

(summarize)
Collapse M_DEFAULT_HOST

Specifies the default Host system of the current MIL application.

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

function map For specifying the data type
CollapseInquireType Description
UserVarPtr
- Possible values returned
Collapse M_TYPE_CHAR

Casts the requested information to a char.

(summarize)
Collapse UserVarPtr data type info

Data type: char

Collapse M_TYPE_MIL_DOUBLE

Casts the requested information to a MIL_DOUBLE.

(summarize)
Collapse UserVarPtr data type info

Data type: MIL_DOUBLE

Collapse M_TYPE_MIL_FLOAT

Casts the requested information to a MIL_FLOAT.

(summarize)
Collapse UserVarPtr data type info

Data type: MIL_FLOAT

Collapse M_TYPE_MIL_ID

Casts the requested information to a MIL_ID.

(summarize)
Collapse UserVarPtr data type info

Data type: MIL_ID

Collapse M_TYPE_MIL_INT

Casts the requested information to a MIL_INT.

(summarize)
Collapse UserVarPtr data type info

Data type: MIL_INT

Collapse M_TYPE_MIL_INT16

Casts the requested results to a MIL_INT16.

(summarize)
Collapse UserVarPtr data type info

Data type: MIL_INT16

Collapse M_TYPE_MIL_INT32

Casts the requested information to a MIL_INT32.

(summarize)
Collapse UserVarPtr data type info

Data type: MIL_INT32

Collapse M_TYPE_MIL_INT64

Casts the requested information to a MIL_INT64.

(summarize)
Collapse UserVarPtr data type info

Data type: MIL_INT64

Collapse M_TYPE_TEXT_CHAR

Casts the requested information to a MIL_TEXT_CHAR.

(summarize)
Collapse UserVarPtr data type info
  • Data type: MIL_TEXT_CHAR
    Note: When a single inquire.

  • Data type: array of type MIL_TEXT_CHAR
    Array size: Size depends on the contents of the array
    Note: When multiple inquires.

Return value
The returned value is the requested information, cast to a MIL_INT. If the requested information is not a single value, this function will return M_NULL.
Compilation information
Header Include mil.h.
Library Use mil.lib; milocr.lib.
DLL Requires mil.dll; milocr.dll.
BLANK CHARACTERS DISABLE ENABLE BROKEN CHAR DISABLE ENABLE CHAR ACCEPTANCE CHAR CELL SIZE X CHAR CELL SIZE Y CHAR IN FONT NULL CHAR INVALID NULL CHAR NUMBER CHAR NUMBER IN FONT CHAR OFFSET X CHAR OFFSET Y CHAR POSITION VARIATION X CHAR POSITION VARIATION Y CHAR SIZE X CHAR SIZE Y CHAR THICKNESS CONSTRAINT n NULL CONSTRAINT TYPE n DEFAULT ANY DIGIT LETTER CONTEXT CONSTRAINED GENERAL EXTRA CHARACTERS DISABLE ENABLE FONT INIT FLAG FOREGROUND BLACK FOREGROUND WHITE FONT TYPE SEMI M12 92 SEMI M13 88 USER DEFINED FOREGROUND VALUE FOREGROUND BLACK FOREGROUND WHITE MORPHOLOGIC FILTERING PREPROCESSED SKIP STRING LOCATION DISABLE ENABLE SPEED HIGH LOW MEDIUM VERY HIGH VERY LOW STRING ACCEPTANCE STRING ANGLE ACCORDING TO REGION STRING ANGLE DELTA NEG STRING ANGLE DELTA POS STRING ANGLE INTERPOLATION MODE BICUBIC BILINEAR NEAREST NEIGHBOR STRING NUMBER ALL STRING SIZE ANY STRING SIZE MAX TARGET CHAR SIZE X SAME TARGET CHAR SIZE Y SAME TARGET CHAR SPACING ANY SAME TEXT STRING SEPARATOR THICKEN CHAR THRESHOLD AUTO TOUCHING CHAR DISABLE ENABLE LOWERCASE UPPERCASE CONSTRAINED GENERAL SORT RESULT OUTPUT UNITS ACCORDING TO CALIBRATION PIXEL WORLD SELECT STRING ALL OWNER SYSTEM DEFAULT HOST TYPE CHAR TYPE MIL DOUBLE TYPE MIL FLOAT TYPE MIL ID TYPE MIL INT TYPE MIL INT16 TYPE MIL INT32 TYPE MIL INT64 TYPE TEXT CHAR GENERAL