MIL_ID FontContextOrResultOcrId, | //in |
MIL_INT64 ControlType, | //in |
MIL_DOUBLE ControlValue | //in |
This function allows you to control an OCR read/verify operation setting. This function also allows you to control various settings that affect how results are retrieved by MocrGetResult(). To inquire the current value of a particular control type, use MocrInquire().
After changing the OCR controls or constraints, use MocrPreprocess() to speed up any following read or verify operation.
Specifies the identifier of the OCR font context or the OCR result buffer to control.
Specifies the type of control to set.
See the Parameter associations section for possible values that can be specified.
Specifies the required value for the control.
See the Parameter associations section for possible values that can be specified.
The tables below list possible values for the ControlType and ControlValue parameters.
The following ControlType and corresponding ControlValue parameter settings are used to specify the characteristics of the font.
For the characteristics of the
font
|
|||||||||||||||||||||||||||||||||||||||
ControlType |
Description
|
||||||||||||||||||||||||||||||||||||||
ControlValue | |||||||||||||||||||||||||||||||||||||||
M_CHAR_ERASE |
Erases a character from the font of the OCR font context. (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the ASCII character associated with the character. (more details...) |
The following ControlType and corresponding ControlValue parameter settings are used to specify operational controls for read and verify operations.
For operation controls for read and
verify operations
|
|||||||||||||||||||||||||||||||||||||||
ControlType |
Description
|
||||||||||||||||||||||||||||||||||||||
ControlValue | |||||||||||||||||||||||||||||||||||||||
M_BLANK_CHARACTERS |
Sets whether the space between characters in the target image is read or not. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DISABLE |
Specifies that blank spaces will not be read from the target image into the result string. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ENABLE |
Specifies that blank spaces will be read from the target image into the result string. |
||||||||||||||||||||||||||||||||||||||
M_BROKEN_CHAR |
Sets the capability to read/verify a broken character. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DISABLE |
Specifies that, during the read/verify, OCR should not try to compensate for broken characters. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ENABLE |
Specifies that broken characters should be identifies as possible characters. |
||||||||||||||||||||||||||||||||||||||
M_CHAR_ACCEPTANCE |
Sets the acceptance level used to determine a successful match between the font and the characters found within the target image. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
0.0 <= Value <= 100.0 |
Specifies the acceptance level for a target character. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CHAR_INVALID |
Sets the ASCII character for all characters within the selected string or strings during the next read or verify operation whose match scores fall below the character acceptance level. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NULL |
Specifies that no special character will replace unrecognized characters. (more details...) |
||||||||||||||||||||||||||||||||||||||
1 <= Value <= 255 |
Specifies the character that will replace unrecognized characters. |
||||||||||||||||||||||||||||||||||||||
M_CONTEXT_CONVERT |
Changes the type of OCR font context. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CONSTRAINED |
Specifies an OCR font context that works well with degraded target images. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_GENERAL |
Specifies an OCR font context that works well with clean target images. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_EXTRA_CHARACTERS |
Sets whether to still read and identify the string when the image contains more characters than otherwise expected. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_DISABLE. |
||||||||||||||||||||||||||||||||||||||
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_MORPHOLOGIC_FILTERING |
Sets the number of iterations of morphological filtering. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
0 <= Value <= 100 |
Specifies the number of iterations. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SKIP_STRING_LOCATION |
Sets whether to first locate the strings in the target image before trying to identify characters against the OCR font context or to skip this step and save processing time. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DISABLE |
Specifies that the step will not be skipped. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ENABLE |
Specifies that the step will be skipped. |
||||||||||||||||||||||||||||||||||||||
M_SPEED |
Sets the algorithm's search speed. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_HIGH |
Specifies a high speed. |
||||||||||||||||||||||||||||||||||||||
M_LOW |
Specifies a low speed. |
||||||||||||||||||||||||||||||||||||||
M_MEDIUM |
Specifies a medium speed. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_VERY_HIGH |
Specifies a very high speed. |
||||||||||||||||||||||||||||||||||||||
M_VERY_LOW |
Specifies a very low speed. |
||||||||||||||||||||||||||||||||||||||
M_STRING_ACCEPTANCE |
Sets the acceptance level used to determine a successful match between the font and a read/verified string. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
0.0 <= Value <= 100.0 |
Specifies the acceptance level for a string. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_STRING_ANGLE_INTERPOLATION_MODE |
Sets the interpolation mode to use when reading/verifying a string at an angle. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_BICUBIC |
Specifies that bicubic interpolation should be used. |
||||||||||||||||||||||||||||||||||||||
M_BILINEAR |
Specifies that bilinear interpolation should be used. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_NEAREST_NEIGHBOR |
Specifies that nearest neighbor interpolation should be used. |
||||||||||||||||||||||||||||||||||||||
M_TOUCHING_CHAR |
Sets the capability to read/verify characters that touch each other in the target image. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DISABLE |
Specifies to disable the identification of touching characters. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ENABLE |
Specifies to enable the identification of touching characters. |
The following ControlType and corresponding ControlValue parameter settings are used to set the characteristics of the target characters.
For the characteristics of the target
characters
|
|||||||||||||||||||||||||||||||||||||||
ControlType |
Description
|
||||||||||||||||||||||||||||||||||||||
ControlValue | |||||||||||||||||||||||||||||||||||||||
M_CHAR_POSITION_VARIATION_X |
Sets the amount by which the position of the characters in the target string can vary along the X-axis. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
0.0 <= Value <= 100.0 |
Specifies the position tolerance, in pixels of the character, not of the target image. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CHAR_POSITION_VARIATION_Y |
Sets the amount by which the position of the characters in the target string can vary along the Y-axis. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
0.0 <= Value <= 100.0 |
Specifies the position tolerance, in pixels of the character, not of the target image. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_STRING_ANGLE |
Sets the expected angle at which the string can be found. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ACCORDING_TO_REGION |
Specifies to use the angle of the rectangular ROI (set using MbufSetRegion()) associated with the target image buffer. (more details...) |
||||||||||||||||||||||||||||||||||||||
0 <= Value <= 360 |
Specifies the angle, in degrees. |
||||||||||||||||||||||||||||||||||||||
M_STRING_ANGLE_DELTA_NEG |
Sets the possible angle variation in a clockwise rotation, relative to M_STRING_ANGLE. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
0 <= Value <= 180 |
Specifies the possible clockwise angle variation, in degrees. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_STRING_ANGLE_DELTA_POS |
Sets the possible angle variation in a counter-clockwise rotation, relative to M_STRING_ANGLE. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
0 <= Value <= 180 |
Specifies the possible counter-clockwise angle variation, in degrees. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_STRING_NUMBER |
Sets the number of strings to be read/verified from the target image. INQ (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. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_STRING_SIZE |
Sets the length of the string to be read/verified from the target image. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ANY |
Specifies that the length of the string is unknown. (more details...) |
||||||||||||||||||||||||||||||||||||||
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. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_TARGET_CHAR_SIZE_X |
Sets the width of the target characters. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SAME |
Specifies that the character width is found automatically. (more details...) |
||||||||||||||||||||||||||||||||||||||
Value > 1 |
Specifies the character width in pixels (with subpixel accuracy). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_TARGET_CHAR_SIZE_Y |
Sets the height of the target characters. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SAME |
Specifies that the character height is found automatically. (more details...) |
||||||||||||||||||||||||||||||||||||||
Value > 1 |
Specifies the character height in pixels (with subpixel accuracy). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_TARGET_CHAR_SPACING |
Sets the amount of space between characters in the string. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ANY |
Specifies that the inter-character spacing is unknown and not the same between the characters. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SAME |
Specifies that the inter-character spacing is the same throughout the target string. (more details...) |
||||||||||||||||||||||||||||||||||||||
Value >= 2 |
Specifies the inter-character spacing, in pixels, with subpixel accuracy. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_TEXT_STRING_SEPARATOR |
Sets the ASCII character to be used as a string separator within the text read/verified. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the ASCII code of the character. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_THICKEN_CHAR |
Sets the number of character thickening iterations. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the default value; the default value is 0. |
||||||||||||||||||||||||||||||||||||||
0 <= Value <= 100 |
Specifies the number of times a character should be thickened. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_THRESHOLD |
Sets the threshold value used to internally binarize the target image for segmentation of characters. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_AUTO |
Specifies to use an automatically computed threshold value. |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies the threshold value. (more details...) |
The following ControlType and corresponding ControlValue parameter settings are used to control settings of the result buffer.
For the result buffer
|
|||||||||||||||||||||||||||||||||||||||
ControlType |
Description
|
||||||||||||||||||||||||||||||||||||||
ControlValue | |||||||||||||||||||||||||||||||||||||||
M_RESULT_OUTPUT_UNITS |
Sets whether to return results in pixels or world units. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Same as M_ACCORDING_TO_CALIBRATION. |
||||||||||||||||||||||||||||||||||||||
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. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_SELECT_STRING |
Selects the line of text to return from the result buffer, when multiple lines of text are read/verified. INQ (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ALL |
Specifies that all strings are selected. (more details...) |
||||||||||||||||||||||||||||||||||||||
Value |
Specifies a specific string. (more details...) |
void MocrControlInt64
(MIL_ID
FontContextOrResultOcrId, MIL_INT64 ControlType,
MIL_INT64 ControlValue)
Parameters
FontContextOrResultOcrId See FontContextOrResultOcrId of the main function for a description. ControlType See ControlType of the main function for a description. ControlValue See ControlValue of the main function for a description. |
Header | Include mil.h. |
Library | Use mil.lib; milocr.lib. |
DLL | Requires mil.dll; milocr.dll. |