An open API service indexing awesome lists of open source software.

https://github.com/ocr-d/workflow-demo

Taverna Workflow Beispiel zu Demonstrationszwecken
https://github.com/ocr-d/workflow-demo

optical-character-recognition taverna-workbench workflow-management-system

Last synced: 3 months ago
JSON representation

Taverna Workflow Beispiel zu Demonstrationszwecken

Awesome Lists containing this project

README

        

# workflow-demo

[Taverna](https://taverna.incubator.apache.org/) Workflow Beispiele zu Demonstrationszwecken

* [Anforderungen](#anforderungen)
* [Java](#java)
* [Taverna Workbench Core 2.5](#taverna-workbench-core-25)
* [Tesseract OCR 4.00](#tesseract-ocr-400)
* [Apache Commons Lang3](#apache-commons-lang3)
* [kraken](#kraken)
* [ScanTailor](#scantailor)
* [Workflows](#workflows)
* [Workflow ``Demo_1.t2flow``](#workflow-demo_1t2flow)
* [Workflow ``Demo_2.t2flow``](#workflow-demo_2t2flow)
* [Workflow ``Demo_3.t2flow``](#workflow-demo_3t2flow)

## Anforderungen

Die folgenden Softwarekomponenten sind erforderlich:

### [Java](https://java.com/download)

Es wird das JRE (Java Runtime Environment) in der Version 7 oder neuer benötigt.

### [Taverna Workbench Core 2.5](http://www.taverna.org.uk/download/workbench/2-5/core/)

Für diesen Workflow wird die Version 2.5 des Taverna Workbench Core benötigt, also das letzte Release vor dem Apache Incubator.

### [Tesseract OCR 4.00](https://github.com/tesseract-ocr/tesseract/wiki)

Für diesen Workflow wird Tesseract OCR in der Version 4.00 oder neuer benötigt.
Windows-Benutzer können z.B.
[hier](https://github.com/UB-Mannheim/tesseract/wiki) vorkompilierte Binaries
für Tesseract 4.00 finden. Nach der Installation müssen Windows-Benutzer den
Pfad zum Verzeichnis `tessdata` sowie zu `tesseract.exe` noch zu den
Umgebungsvariablen hinzufügen.

Für Debian-basiertes Linux gibt es ein [PPA für Tesseract
4](https://launchpad.net/~alex-p/+archive/ubuntu/tesseract-ocr), das auch
die notwendigen [Leptonica](http://www.leptonica.org/download.html) in der Version 1.74 enthält.

```sh
sudo add-apt-repository ppa:alex-p/tesseract-ocr
sudo apt update
sudo apt install tesseract-ocr
cd /usr/share/tesseract-ocr/4.00/tessdata
sudo wget 'https://cdn.rawgit.com/tesseract-ocr/tessdata_best/master/Fraktur.traineddata'
sudo wget 'https://github.com/tesseract-ocr/tessdata/blob/3.04.00/deu_frak.traineddata?raw=true
```

### [Apache Commons Lang3](https://commons.apache.org/proper/commons-lang/)

Laden Sie bitte die Datei `commons-lang3-3.6-bin.tar.gz` bzw.
`commons-lang3-3.6-bin.zip` herunter und entpacken sie dieses Archiv.
Anschließend muss die Datei `commons-lang3-3.6.jar` noch in das
Unterverzeichnis `lib` der Taverna-Installation kopiert werden.

```
cd /opt/taverna-workbench-core/lib
sudo wget 'http://central.maven.org/maven2/org/apache/commons/commons-lang3/3.6/commons-lang3-3.6.jar'
```

### [kraken](http://kraken.re/)

Installieren Sie kraken und laden Sie mit ``kraken get fraktur`` das RNN-Model für Fraktur herunter.

```sh
git clone --depth 1 https://github.com/mittagessen/kraken
cd kraken
pip install --user .
kraken get default
kraken get fraktur
```

### [ScanTailor](http://scantailor.org/)

Zuletzt muss nun noch ScanTailor installiert werden.

```sh
sudo apt install cmake libboost-all-dev libtiff5-dev libxrender-dev zlib1g-dev libpng-dev libjpeg-dev libqt4-dev
wget 'https://github.com/scantailor/scantailor/archive/RELEASE_0_9_12_2.zip'
unzip RELEASE_0_9_12_2.zip
cd scantailor-RELEASE_0_9_12_2/
cmake .
make -j4
sudo make install
```

Nach der erfolgreichen Installation der oben genannten Softwarekomponenten sind ggf. noch die in der Workflowbeschreibung enthaltenen Pfade/Verzeichnisse für die lokale Umgebung anzupassen.

## Workflows

### Workflow ``Demo_1.t2flow``

This workflow takes an image and ground truth text as input, performs OCR using
Tesseract 4.0 and compares the OCR output to the ground truth using Levensthein
distance measure.

![Workflow 1 diagram](https://user-images.githubusercontent.com/952378/30741474-3393ee40-9f95-11e7-9718-2ad5781bd0d7.png)

**NOTE**: The `image` and `ground_truth` input ports expect the absolute path
to image/text files, not file contents. Make sure you choose `Set value`, not
`Set file location`.

### Workflow ``Demo_2.t2flow``

This workflow takes an image and ground truth text as input, performs
binarization of the image using Kraken's 'nlbin' method, subsequently submits
the bitonal image to OCR using Tesseract 3, Tesseract 4 and Kraken and then
compares each OCR output with the ground truth using Levenshtein distance
measure.

![Workflow 2 diagram](https://user-images.githubusercontent.com/952378/33178231-ba6622ca-d065-11e7-9239-2a8c3cc9e636.png)

### Workflow ``Demo_3.t2flow``

This workflow takes an image as input, performs image optimization (cropping,
deskewing, despeckling) with ScanTailor, binarizes the image using Kraken's
'nlbin' method, subsequently submits the bitonal image to OCR using Tesseract 4
and Kraken and finally creates an optimal OCR result by merging the two OCR
outputs based on a dictionary.

![Workflow 3 diagram](https://user-images.githubusercontent.com/952378/33178131-4d911268-d065-11e7-9bf9-c510b9a93bd1.png)