MergeCharactersIntoOneLine
Converts the output of the Deep Learning filter DL_ReadCharacters into a single text value, with the detected lines separated by a new line character.
Syntax
C++
Python
def MergeCharactersIntoOneLine( inCharacters: list[OcrResult], inMaxGap: float, inMaxShift: float, inMargin: float, inMinLength: int, inPattern: str, inMinScore: float, inLineDirection: LineDirection, /, *, inCandidates: list[ list[OcrCandidate] ] | None = None ) -> ( outText: str, outLine: Rectangle2D, outScore: float, outMapping: list[int | None], outProcessedCharacters: list[OcrResult] )
Parameters
| Name | Type | Range | Default | Description | |
|---|---|---|---|---|---|
![]() |
inCharacters | list[OcrResult] | Output of DL_ReadCharacters | ||
![]() |
inMaxGap | float | 0.0 - 10.0 | Maximum gap between adjacent characters along the reading direction, denoted as fraction of 'A' char height | |
![]() |
inMaxShift | float | 0.0 - 1.0 | Maximum misalignment between adjacent characters perpendicular to the reading direction, denoted as fraction of 'A' char height | |
![]() |
inMargin | float | 0.0 - 10.0 | Additional margin added to result, denoted as fraction of 'A' char height | |
![]() |
inMinLength | int | 1 - 200 | Minimal number of chars to create line | |
![]() |
inPattern | str | Pattern used in Grammar rules filtering; a new line escape sequence is supported to match across detected lines | ||
![]() |
inCandidates | list[ list[OcrCandidate] ] | None | None | Candidates - optional output of DL_ReadCharacters, Required when using grammar rules (when inPattern is not empty) | |
![]() |
inMinScore | float | 0.0 - 1.0 | Minimum score for filtering the line of text | |
![]() |
inLineDirection | LineDirection | Expected text orientation direction | ||
![]() |
outText | str | All merged characters as a single text value, with the detected lines separated by a new line character | ||
![]() |
outLine | Rectangle2D | Minimal box which covers all selected character boxes | ||
![]() |
outScore | float | Calculated score for the whole result | ||
![]() |
outMapping | list[int | None] | Mapping between input characters and the output text, outMapping[i] is 0 if inCharacters[i] has been added to the result, NIL otherwise | ||
![]() |
outProcessedCharacters | list[OcrResult] | Contains the full set of character results after grammar rule processing. Maintains a one-to-one correspondence with inCharacters, preserving original positions but possibly with modified values, scores, or other attributes based on grammar rule application. |


