No description
Find a file
vahidrezanezhad 3518618a01
Merge pull request #28 from qurator-spk/fix-unbound-var
extract page_image also for operation_level region
2021-03-22 15:59:39 +01:00
.circleci use resmgr for model download 2021-01-28 14:09:18 +01:00
repo add assets subrepo 2020-10-15 17:31:47 +02:00
sbb_binarize extract page_image also for operation_level region 2021-03-22 15:44:04 +01:00
.gitignore 📦 v0.0.2 2020-10-23 17:09:54 +02:00
.gitkeep Add new directory, you can find corresponding models in qurator-data 2019-08-23 15:47:32 +02:00
.gitmodules add assets subrepo 2020-10-15 17:31:47 +02:00
CHANGELOG.md 📦 v0.0.7 2021-02-02 17:47:35 +01:00
LICENSE Add LICENSE 2019-12-10 16:40:44 +01:00
make.sh Add new file 2019-08-23 15:50:09 +02:00
Makefile fix test 2021-01-28 14:19:22 +01:00
ocrd-tool.json add ocrd-tool.json 2020-10-15 15:19:04 +02:00
README.md Mention OCR-D interface in the README, fixes GH-22 2021-01-18 15:17:46 +01:00
requirements.txt processor: self.resolve_resource model in addition to SBB_BINARIZE_DATA 2021-01-28 12:44:47 +01:00
setup.py minimal CI setup 2020-10-16 13:52:44 +02:00

Binarization

Binarization for document images

Examples

Introduction

This tool performs document image binarization (i.e. transform colour/grayscale to black-and-white pixels) for OCR using multiple trained models.

The method used is based on Calvo-Zaragoza/Gallego, 2018. A selectional auto-encoder approach for document image binarization.

Installation

Clone the repository, enter it and run

pip install .

Models

Pre-trained models can be downloaded from here:

https://qurator-data.de/sbb_binarization/

Usage

sbb_binarize \
  --patches \
  -m <directory with models> \
  <input image> \
  <output image>

Note In virtually all cases, the --patches flag will improve results.

To use the OCR-D interface:

ocrd-sbb-binarize --overwrite -I INPUT_FILE_GRP -O OCR-D-IMG-BIN -P model "/var/lib/sbb_binarization"