Back to FabImage Studio website
You are here: Start » Filter Reference » Computer Vision » Deep Learning » MergeCharactersIntoLines
Module: | DL_OCR |
---|
Converts a output of DL_ReadCharacters to lines of text.
Name | Type | Range | Description | |
---|---|---|---|---|
![]() |
inCharacters | OcrResultArray | Output of DL_ReadCharacters | |
![]() |
inMaxGap | Real | 0.0 - 10.0 | Maximum horizontal gap between joint characters' boxes, denoted as fraction of 'A' char height |
![]() |
inMaxShift | Real | 0.0 - 1.0 | Maximum vertical misalignment between joint character's boxes, denoted as fraction of 'A' char height |
![]() |
inMargin | Real | 0.0 - 10.0 | Additional margin added to result, denoted as fraction of 'A' char height |
![]() |
inMinLength | Integer | 1 - 200 | Minimal number of chars to create line |
![]() |
inFlatten | Bool | If True, it concatenates the words on the line into a single result string, otherwise each word is a separate result string | |
![]() |
outLines | Rectangle2DArray | Minimal Box which cover all selected character boxes | |
![]() |
outStrings | StringArray | Text of merged characters | |
![]() |
outMapping | Integer?Array | Mapping between input characters and output lines, outMapping[i] stores the index line to which inCharacters[i] belongs. If outMapping[i] is NIL it means that inCharacters[i] has not been added to any line |
Description
This tool takes the text contained in OcrResultArray from the DL_ReadCharacters and merges it into lines.
Hints
- Depending on the inMaxGap and inMaxShift values, we can get different number of lines. See the image below, where increasing the inMaxGap results in one line of text, whereas a smaller value will return two separate lines:
- The lines are sorted by the Y value, e.g.:
- The tool can also be used to get rid of false characters by setting a different value of the inMinLength parameter. In the image below setting the inMinLength to 2 resulted in filtering out single false characters returned by the DL_ReadCharacters tool.



Complexity Level
This filter is available on Expert Complexity Level.
See Also
- DL_ReadCharacters – Performs optical character recognition using a pretrained deep learning model.