Skip to main content

MocrInquire

BoardSupported
Host SystemYes
V4L2Yes
Clarity UHDYes
Concord PoENo
GenTLYes
GevIQYes
GigE VisionYes
IndioNo
Iris GTXYes
Radient eV-CLYes
Rapixo CLYes
Rapixo CoFYes
Rapixo CXPYes
USB3 VisionYes

Inquire about OCR font context or an OCR result buffer setting.

Syntax

AIL_INT MocrInquire(
AIL_ID FontContextOrResultOcrId, //in
AIL_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.

Parameters

FontContextOrResultOcrId (in, AIL_ID)

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

InquireType (in, AIL_INT64)

Specifies the type of setting about which to inquire.

UserVarPtr *(out, void)

Specifies the address in which to write the requested information. Since the MocrInquire function also returns the requested information, you can set this parameter to M_NULL.

Parameter Associations

For OCR settings

For an OCR font context, the InquireType parameter can be set to one of the following:


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.

ValueDescription
M_DISABLE (default)Specifies that blank spaces will not be read from the target image into the result string.
M_ENABLESpecifies 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.

ValueDescription
M_DISABLE (default)Specifies that, during the read/verify, OCR should not try to compensate for broken characters.
M_ENABLESpecifies 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.

ValueDescription
0.0 <= Value <= 100.0 (default)Specifies the acceptance level for a target character.

M_CHAR_CELL_SIZE_X

Inquires the font's character cell width.

ValueDescription
6 <= Value <= 256Specifies the width, in pixels.

M_CHAR_CELL_SIZE_Y

Inquires the font's character cell height.

ValueDescription
6 <= Value <= 256Specifies the height, in pixels.

M_CHAR_IN_FONT

Inquires the string of ASCII characters associated with the character representations in the font.

ValueDescription
M_NULLSpecifies 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.

ValueDescription
M_NULL (default)Specifies that no special character will replace unrecognized characters.
1 <= Value <= 255Specifies 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.

ValueDescription
ValueSpecifies the number of characters.

M_CHAR_NUMBER_IN_FONT

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

ValueDescription
ValueSpecifies the number of characters.

M_CHAR_OFFSET_X

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

ValueDescription
ValueSpecifies the offset along the X-axis, in pixels.

M_CHAR_OFFSET_Y

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

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

ValueDescription
0.0 <= Value <= 100.0 (default)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. This value is expressed in pixels of the character, not of the target image.

ValueDescription
0.0 <= Value <= 100.0 (default)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.

ValueDescription
6 <= Value <= 256Specifies the width, in pixels.

M_CHAR_SIZE_Y

Inquires the height of the font's characters.

ValueDescription
6 <= Value <= 256Specifies the height, in pixels.

M_CHAR_THICKNESS

Inquires the average thickness of the font's characters.

ValueDescription
ValueSpecifies the average thickness, in pixels.

M_CONSTRAINT + n

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

ValueDescription
M_NULLSpecifies 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.

ValueDescription
M_DEFAULT
M_ANY (default)Specifies that all characters present in the font are valid.
M_DIGITSpecifies that only characters "0" to "9" (ASCII codes 48 to 57) are valid.
M_LETTERSpecifies that only characters "A" to "Z" and "a" to "z" (ASCII codes 65 to 90 and 97 to 122) are valid.
M_LOWERCASESpecifies that only characters "a" to "z" (ASCII codes 97 to 122) are valid.
M_UPPERCASESpecifies that only characters "A" to "Z" (ASCII codes 65 to 90) are valid.

M_CONTEXT

Inquires the type of the OCR font context.

ValueDescription
M_CONSTRAINEDSpecifies an OCR font context that works well with degraded target images.
M_GENERALSpecifies an OCR font context that works well with clean target images.

M_EXTRA_CHARACTERS

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

ValueDescription
M_DEFAULT
M_DISABLE (default)Specifies that the read/verify operation should not try to compensate for extra characters.
M_ENABLESpecifies that the read/verify operation should try to compensate for extra characters.

M_FONT_INIT_FLAG

Inquires the initialization flag passed at font allocation.

ValueDescription
M_FOREGROUND_BLACKSpecifies that the characters to read or verify are darker than the background.
M_FOREGROUND_WHITESpecifies that the characters to read or verify are brighter than the background.

M_FONT_TYPE

Inquires the font type of the OCR font context.

ValueDescription
M_DEFAULT
M_SEMI_M12_92Specifies a font respecting the SEMI M12-92 standard as the type of font.
M_SEMI_M13_88Specifies a font respecting the SEMI M13-88 standard as the type of font.
M_USER_DEFINED (default)Specifies a general, user-defined type of font.
M_CONSTRAINED (default)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.
M_GENERALSpecifies an OCR font context that works well with clean target images.

M_FOREGROUND_VALUE

Inquires the foreground value of the font.

ValueDescription
M_FOREGROUND_BLACKSpecifies that the characters to read or verify are darker than the background.
M_FOREGROUND_WHITESpecifies that the characters to read or verify are brighter than the background.

M_MORPHOLOGIC_FILTERING

Inquires the number of iterations of morphological filtering.

ValueDescription
0 <= Value <= 100 (default)Specifies the number of iterations.

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.

ValueDescription
M_FALSESpecifies that preprocessing is necessary.
M_TRUESpecifies that preprocessing is not necessary.

M_SKIP_STRING_LOCATION

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

ValueDescription
M_DISABLE (default)Specifies that the step will not be skipped.
M_ENABLESpecifies that the step will be skipped.

M_SPEED

Inquires the algorithm's search speed.

ValueDescription
M_HIGHSpecifies a high speed.
M_LOWSpecifies a low speed.
M_MEDIUM (default)Specifies a medium speed.
M_VERY_HIGHSpecifies a very high speed.
M_VERY_LOWSpecifies 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.

ValueDescription
0.0 <= Value <= 100.0 (default)Specifies the acceptance level for a string.

M_STRING_ANGLE

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

ValueDescription
M_ACCORDING_TO_REGION (default)Specifies to use the angle of the rectangular ROI (set using MbufSetRegion) associated with the target image buffer.
0.0 <= Value <= 360.0Specifies the angle, in degrees.

M_STRING_ANGLE_DELTA_NEG

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

ValueDescription
0.0 <= Value <= 180.0 (default)Specifies the possible clockwise angle variation, in degrees.

M_STRING_ANGLE_DELTA_POS

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

ValueDescription
0.0 <= Value <= 180.0 (default)Specifies the possible counter-clockwise angle variation, in degrees.

M_STRING_ANGLE_INTERPOLATION_MODE

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

ValueDescription
M_BICUBICSpecifies bicubic interpolation.
M_BILINEAR (default)Specifies bilinear interpolation.
M_NEAREST_NEIGHBORSpecifies nearest neighbor interpolation.

M_STRING_CHAR_NUMBER

Inquires the length of the string to read/verify from the target image.

ValueDescription
M_ANYSpecifies that the length of the string is unknown.
Value <= M_STRING_SIZE_MAXSpecifies the string length to read/verify.

M_STRING_NUMBER

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

ValueDescription
M_ALLSpecifies that the number of strings in the target image should be determined automatically.
Value (default)Specifies the number of lines of text in the target image.

M_STRING_SIZE_MAX

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

ValueDescription
ValueSpecifies the maximum string length.

M_TARGET_CHAR_SIZE_X

Inquires the width of the expected target characters.

ValueDescription
M_SAMESpecifies that the character width is found automatically.
Value > 1Specifies the character width in pixels (with subpixel accuracy).

M_TARGET_CHAR_SIZE_Y

Inquires the height of the expected target characters.

ValueDescription
M_SAMESpecifies that the character height is found automatically.
Value > 1Specifies the character height in pixels (with subpixel accuracy).

M_TARGET_CHAR_SPACING

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

ValueDescription
M_ANYSpecifies that the inter-character spacing is unknown and not the same between the characters.
M_SAMESpecifies that the inter-character spacing is the same throughout the target string.
Value >= 2Specifies the inter-character spacing, in pixels, with subpixel accuracy.

M_TEXT_STRING_SEPARATOR

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

ValueDescription
Value (default)Specifies the ASCII code of the character.

M_THICKEN_CHAR

Inquires the number of times a character should be thickened.

ValueDescription
M_DEFAULT
0 <= Value <= 100 (default)Specifies the number of times a character should be thickened.

M_THRESHOLD

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

ValueDescription
M_AUTOSpecifies an automatically computed threshold value.
Value (default)Specifies the threshold value.

M_TOUCHING_CHAR

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

ValueDescription
M_DISABLE (default)Specifies to disable the identification of touching characters.
M_ENABLESpecifies to enable the identification of touching characters.

Combination Constants — Returns the length of the constraint string

Optional.

Usage: You can add one of the following values to the above-mentioned values to determine the length of the constraint string.

M_STRING_SIZE

Retrieves the length of the constraint string, including the terminating null character ("\0").

Combination Constants — Returns the letter case for the constraint

Optional.

Usage: You can add one of the following values to the above-mentioned values to determine the letter case for the constraint.

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

Combination Constants — Returns the context type

Essential.

Usage: You must add one of the following values to the above-mentioned values to determine the OCR font context type.

ValueDescription
M_CONSTRAINED (default)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.
M_GENERALSpecifies an OCR font context that works well with clean target images.

Combination Constants — For

Optional.

Usage: You can add one of the following values to the above-mentioned values to specify that the returned string is sorted in ascending ASCII order.

ValueDescription
M_SORTSorts the returned string in ascending ASCII order.

For specifying the result for

For an OCR result buffer, the InquireType parameter can be set to one of the following:


M_RESULT_OUTPUT_UNITS

Inquires whether results are returned in pixel or world units.

ValueDescription
M_DEFAULT
M_ACCORDING_TO_CALIBRATION (default)Specifies that results are returned in world units if the result was calculated on an image associated with a camera calibration context; otherwise, specifies that results are returned in pixel units.
M_PIXELSpecifies that results are returned in pixel units, with respect to the pixel coordinate system.
M_WORLDSpecifies that results are returned in world units, with respect to the relative coordinate system.

M_SELECT_STRING

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

ValueDescription
M_ALLSpecifies that all strings are selected.
0 <= Value < M_STRING_NUMBER (default)Specifies a specific string.

For inquiring about the system

To inquire about the system on which the OCR font context or result buffer is allocated, set the InquireType parameter to the value below.


M_OWNER_SYSTEM

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

ValueDescription
M_DEFAULT_HOSTSpecifies the default Host system of the current Aurora Imaging Library application.
System identifierSpecifies a valid system identifier, previously allocated using MsysAlloc.

Combination Constants — For specifying the data type

Optional.

Usage: You can add one of the following values to the above-mentioned values to cast the requested information to the required data type.

M_TYPE_AIL_DOUBLE

Casts the requested information to an AIL_DOUBLE.

M_TYPE_AIL_FLOAT

Casts the requested information to an AIL_FLOAT.

M_TYPE_AIL_ID

Casts the requested information to an AIL_ID.

M_TYPE_AIL_INT

Casts the requested information to an AIL_INT.

M_TYPE_AIL_INT16

Casts the requested results to an AIL_INT16.

M_TYPE_AIL_INT32

Casts the requested information to an AIL_INT32.

M_TYPE_AIL_INT64

Casts the requested information to an AIL_INT64.

M_TYPE_AIL_UINT8

Casts the requested information to an AIL_UINT8.

M_TYPE_TEXT_CHAR

Casts the requested information to an AIL_TEXT_CHAR.

Return Value

Type: AIL_INT

The returned value is the requested information, cast to an AIL_INT. If the requested information does not fit into an AIL_INT, this function will return M_NULLor truncate the information.

Copyright © 2026 Zebra Technologies.