SaigeTextFormatting¶
#include <SaigeVisionAPI.h>
(OCR) Option for specifying the format of text to be recognized. There are two approaches: setting a character set for recognition regardless of character count, or defining character sets based on character position.
The methods for Text Formatting and how to set them are as follows.
By Character Set (Independent of Character Count)**
- Set the
lengthvalue to 0. - Set the first value of each character set's bool array.
- Example: To recognize only lowercase English letters and numbers:
By Character Pattern (With Specific Length and Pattern)**
1 2 3 4 5 6 7 8 9
// .cpp SaigeInferenceOption option; option.textFormatting.length = 0; option.textFormatting.engLower[0] = true; option.textFormatting.engUpper[0] = false; option.textFormatting.kor[0] = false; option.textFormatting.number[0] = true; option.textFormatting.symbol[0] = false; - Set the length value to greater than 0 and less than or equal to kMaxLenOfTextFormatting.
- Set values from 0 to length-1 in each character set's bool array.
- Example: ABC123DE (3 English character, 2 digits, 3 English character)
1 2 3 4 5 6 7 8 9 10
// .cpp SaigeInferenceOption option; option.textFormatting.length = 8; SaigeInitTextFormatting(&option.textFormatting); // Function to initialize all option values to false for (int i = 0; i < options.textFormatting.length; ++i){ options.textFormatting.number[i] = true; } options.textFormatting.number[3] = false; options.textFormatting.kor[3] = true;
See also: SaigeInitTextFormatting
Public Attributes¶
| Type | Name |
|---|---|
| int | length Specifies the number of characters to recognize. A value of 0 indicates that the option is independent of character count. |
| bool[ ] | engLower Specifies whether to include lowercase English letters. |
| bool[ ] | engUpper Specifies whether to include uppercase English letters. |
| bool[ ] | number Specifies whether to include numbers. |
| bool[ ] | kor Specifies whether to include Korean characters. The supported character set is KSC5601, with possible additional characters. |
| bool[ ] | symbol Specifies whether to include symbols. |
Public Attributes Documentation¶
length¶
Specifies the number of characters to recognize. A value of 0 indicates that the option is independent of character count.
int length;
engLower¶
Specifies whether to include lowercase English letters.
bool[] engLower;
engUpper¶
Specifies whether to include uppercase English letters.
bool[] engUpper;
number¶
Specifies whether to include numbers.
bool[] number;
kor¶
Specifies whether to include Korean characters. The supported character set is KSC5601, with possible additional characters.
bool[] kor;
symbol¶
Specifies whether to include symbols.
bool[] symbol;
The supported symbols are as follows: .,'"·●°_~-+±=*※#%&@:/!?(){}[]<>