OCR-D Quick Start Guide
Open your Ubuntu Terminal
On Ubuntu, open your Terminal.
On Windows, install WSL, Ubuntu and Docker Desktop by following these steps:
- Install WSL 2 by opening the PowerShell and running:
wsl --install
-
Download and install Ubuntu 22.04.2 LTS from Microsoft App Store.
-
Open Ubuntu 22.04.2 LTS and follow the instructions.
- Make sure, Docker Desktop is running.
Install and set up Docker
In the Ubuntu shell, run:
docker ps
If the command is not found, you may need to install Docker first.
Further Requisites
- Install OCR-D via Docker and download example data from Github:
docker pull ocrd/all:maximum mk dir ocr-d cd ocr-d git clone https://github.com/OCR-D/assets mkdir workspace cp -r assets/data/kant_aufklaerung_1784 workspace/kant_aufklaerung_1784 cd workspace/kant_aufklaerung_1784
- Set up Docker :
sudo systemctl enable docker sudo usermod -aG docker $USER docker run --workdir /data --volume $PWD/.config:/.config --volume $PWD:/data --volume $PWD/models:/usr/local/share/ocrd-resources --volume $PWD/models:/usr/local/share/tessdata --volume $PWD/models:/usr/local/share/ocrd-resources -it ocrd/all bash
- Download some models:
mkdir -p $PWD/models/ocrd-tesserocr-recognize sudo mkdir -p /usr/local/share/ocrd-resources/ocrd-tesserocr-recognize/configs cd data ocrd resmgr download '*'
First minimal workflow with OCR-D
ocrd-tesserocr-recognize -I OCR-D-IMG -O OCR-D-TESSOCR -P segmentation_level region -P textequiv_level word -P find_tables true -P model ocrd-tesserocr-recognize -I OCR-D-IMG -O OCR-D-TESSOCR -P segmentation_level region -P textequiv_level word -P find_tables true -P model Fraktur_GT4HistOCR
Congratulations! You ran your first (minimal) OCR-D Workflow.
You will find the results in the directory
workspace/kant_aufklaerung_1784
under data
.
Consult the Setup Guide for more details and other installation methods or jump into the
User Guide to learn more about OCR‑D. Below you find a short explanation for the ocrd-tesserocr-recognize
command.
Explanation
The commandocrd-tesserocr-recognize -I OCR-D-IMG -O OCR-D-TESSOCR -P segmentation_level region -P textequiv_level word -P find_tables true -P model Fraktur_GT4HistOCR
for the recognition contains the following parameters:
ocrd-tesserocr-recognize
is the processor used.-I
is followed by the name of the input folder, here images.-O
is followed by the name of the output folder where you will find the results (here binarised images and mets files with the recognised text.-P segmentation_level region
is a parameter for the processor which tells tesserocr to start the segmentation on the level of regions.-P textequiv_level word
is a parameter for the processor which tells tesserocr to stop the segmentation on the level of words (meaning glyphs will not be segmented here).-P find_tables true
is a parameter for the processor which tells tesserocr to recognise tables.-P model Fraktur_GT4HistOCR
is a parameter for the processor which tells tesserocr to use the modelFraktur_GT4HistOCR
for recognition.