Need better scanning performance?
TextDetectionMode
Parameter TextDetectionMode determines how to detect the text area. For tasks like barcode reading or border detection, the text part is not important; while for the task of text recognition, the results of detected text zone are mandatory.
Example
{
"TextDetectionMode":
{
"Mode": "TTDM_WORD",
"Direction": "HORIZONTAL",
"CharHeightRange": [1,1000,1]
}
}
Parameter Summary
Parameter TextDetectionMode consist of a group of text detection mode objects. Each text detection mode object includes a candidate mode and a series of mode arguments. The mode arguments of the text detection mode object is shown as follow:
Mode Arguments
| Mode Argument Name | Mode Argument Summary |
|---|---|
| Mode (Required) |
Description Any one in Candidate Mode List as string |
| Type String |
|
| Candidate Mode List TTDM_WORD TTDM_LINE TTDM_LAYOUT TTDM_SKIP |
|
| Direction (Optional) |
Description Set the direction to perform text zone detection. |
| Type String |
|
| Range "HORIZONTAL", "VERTICAL", "OBLIQUE", "UNKNOWN" |
|
| Default Value "UNKNOWN" |
|
| Valid For All modes |
|
| CharHeightRange (Optional) |
Description Sets the range of letter height in pixel or a percentage. Format: [MinHeight, MaxHeight, ByThousandth]. if ByThousandth=1, the allowed values for MinHeight/MaxHeight=[1, 1000] if ByThousandth=0, the allowed values for MinHeight/MaxHeight=[1, 0x7fffffff] |
| Type int array |
|
| Range [1, 0x7fffffff] |
|
| Valid For All modes |
|
| MaxSpacingInALine (Optional) |
Description Sets the maximum spacing between characters treated as one line. |
| Type int |
|
| Range [-1, 0x7fffffff] |
|
| Default Value -1 |
|
| Valid For TTDM_LINE |
|
| Remarks -1: means automatically set by the library. It is a percentage value relative to the average letter height of each line. |
|
| Sensitivity (Optional) |
Description Sets the sensitivity of text detection. |
| Type int |
|
| Range [1, 9] |
|
| Valid For All modes |
|
| StringLengthRange (Optional) |
Description Sets a range to restrict the string length. |
| Type int[] |
|
| Range Each member of the array should be in [0, 0x7fffffff] |
|
| Default Value LabelRecognizer: [3,50]. BarcodeReader & DocumentNormalizer: null |
|
| Valid For All modes |
|
| LibraryFileName (Optional) |
Description Sets the file name of the library to load dynamically. |
| Type String |
|
| Range A string value representing file name. |
|
| Default Value "" |
|
| Valid For All modes. |
|
| LibraryParameters (Optional) |
Description The library must be in the same place with Dynamsoft Barcode Reader Library. |
| Type String |
|
| Range A string value representing parameters. |
|
| Default Value "" |
|
| Valid For All modes. |
Default Setting
For Barcode Decoding
{
"TextDetectionMode" :
{
"Mode" : "TTDM_LINE",
"Direction" : "UNKNOWN",
"CharHeightRange" : [1, 1000, 1],
"MaxSpacingInALine" : -1,
"Sensitivity" : 3
}
}
For Label Recognizing
{
"TextDetectionMode" :
{
"Mode" : "TTDM_LINE",
"Direction" : "HORIZONTAL",
"CharHeightRange" : [20, 1000, 1],
"MaxSpacingInALine" : -1,
"Sensitivity" : 7
}
}
For Document Scanning
{
"TextDetectionMode" :
{
"Mode" : "TTDM_WORD",
"Direction" : "HORIZONTAL",
"CharHeightRange" : [1, 1000, 1],
"Sensitivity" : 7
}
}
Candidate Modes Introduction
TTDM_WORD
Find the text area based on the “word” objects. It is the fastest text detection mode but has the lowest accuracy.
TTDM_LINE
Find the text area based on the “text line” objects. This mode has higher accuracy than the TTDM_WORD. It is currently implemented as the default mode for text line recognizing.
TTDM_LAYOUT
Find the text area based on the layout. A mode with even higher accuracy than the TTDM_LINE. Not supported yet.