2019-12-09 15:11:25 +01:00
|
|
|
# Textline Detection
|
2020-01-15 19:41:49 +01:00
|
|
|
> Detect textlines in document images
|
2019-10-10 16:13:07 +02:00
|
|
|
|
2019-12-09 15:11:25 +01:00
|
|
|
## Introduction
|
2019-12-11 13:33:21 +01:00
|
|
|
This tool performs printspace, region and textline detection from document image
|
2020-01-15 19:41:49 +01:00
|
|
|
data and returns the results as [PAGE-XML](https://github.com/PRImA-Research-Lab/PAGE-XML).
|
2019-10-10 16:13:07 +02:00
|
|
|
|
2019-12-09 15:11:25 +01:00
|
|
|
## Installation
|
|
|
|
`pip install .`
|
2019-12-05 16:30:09 +01:00
|
|
|
|
2020-01-16 15:57:20 +01:00
|
|
|
### Models
|
2020-01-15 19:41:49 +01:00
|
|
|
In order to run this tool you also need trained models. You can download our pretrained models from here:
|
2020-01-16 15:47:04 +01:00
|
|
|
https://qurator-data.de/sbb_textline_detector/
|
2019-12-05 16:30:09 +01:00
|
|
|
|
2019-12-09 15:11:25 +01:00
|
|
|
## Usage
|
|
|
|
`sbb_textline_detector -i <image file name> -o <directory to write output xml> -m <directory of models>`
|
2019-12-05 16:15:07 +01:00
|
|
|
|
2020-01-16 15:57:20 +01:00
|
|
|
### Usage with OCR-D
|
2019-12-06 11:42:23 +01:00
|
|
|
~~~
|
|
|
|
ocrd-example-binarize -I OCR-D-IMG -O OCR-D-IMG-BIN
|
2019-12-09 15:11:25 +01:00
|
|
|
ocrd-sbb-textline-detector -I OCR-D-IMG-BIN -O OCR-D-SEG-LINE-SBB \
|
2019-12-06 12:34:15 +01:00
|
|
|
-p '{ "model": "/path/to/the/models/textline_detection" }'
|
2019-12-06 11:42:23 +01:00
|
|
|
~~~
|
|
|
|
|
2020-05-29 17:08:29 +02:00
|
|
|
Segmentation works on raw RGB images, but retains
|
|
|
|
`AlternativeImage`s from binarization steps, so it's OK to do
|
2019-12-06 11:42:23 +01:00
|
|
|
binarization first, then perform the textline detection. The used binarization
|
|
|
|
processor must produce an `AlternativeImage` for the binarized image, not
|
|
|
|
replace the original raw RGB image.
|