MIL_ID FontContextOcrId, | //in |
MIL_INT CharPos, | //in |
MIL_INT64 CharPosType, | //in |
MIL_CONST_TEXT_PTR CharValidString | //in |
This function specifies which character value constraints to apply to each position of the strings in the target image, when using the specified OCR font context. This function specifies which characters can appear at given positions in the string to be read, and associates these constraints with the OCR font context. Using this function increases both speed and reliability as long as the strings in the target image have a known format and obey certain grammatical rules.
Note that constraints are set in regards to the character's position in the string. When dealing with multiple strings, the same constraints are applied to each string.
If you change any constraints, use MocrPreprocess() to speed up any following read or verify operation.
Specifies the character position in the string for which a constraint is being set. Valid values range from zero to the length of the string -1.
Specifies the type of character that can appear at the specified string position.
This parameter should be set to one of the following values:
For specifying the type of character that
is accepted
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
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. |
You can add one of the following values to the above-mentioned value to specify the letter case of the characters accepted.
For M_LETTER to specify which characters
are accepted
|
|||||||||||||||||||||||||||||||||||||||
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. |
Specifies that any character matching the given CharPosType will be accepted as valid, or explicitly lists valid characters for the specified position.
For specifying whether all characters
matching the CharPosType will be accepted
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_NULL |
Sets all font characters matching the CharPosType parameter value as valid. |
||||||||||||||||||||||||||||||||||||||
MIL_TEXT("StringOfCharacters") 1 |
Specifies an explicit list of valid characters for the specified position. (more details...) |
1 If you are passing the value in a variable, don't enclose it in MIL_TEXT().
Header | Include mil.h. |
Library | Use mil.lib; milocr.lib. |
DLL | Requires mil.dll; milocr.dll. |