-
Notifications
You must be signed in to change notification settings - Fork 7
Workflow Guide recommendations
In order to facilitate the usage of OCR-D and the configuration of workflows, we provide two workflows which can be used as a start for your OCR-D-tests. They were determined by testing the processors listed above on selected pages of some prints from the 17th and 18th century.
The results vary quite a lot from page to page. In most cases, segmentation is a problem.
Note that for our test pages, not all steps described above werde needed to obtain the best results. Depending on your particular images, you might want to include those processors again for better results.
We are currently working on regression tests with the help of which we will be able to provide more profound workflows soon, which will replace those interim solutions.
Since ocrd-tesserocr-recognize
can do binarization (Otsu), region
segmentation, table recognition, line segmentation and text recognition at once, just like the
upstream tesseract
command line tool, it's a good single-step workflow to get
a baseline result to compare to granular workflows.
Note: Be aware that you will most likely obtain significantly better results by configuring a more granular workflow like e.g. the workflows below.
Step | Processor | Parameter |
---|---|---|
1 | ocrd-tesserocr-recognize | -P segmentation_level region -P textequiv_level word -P find_tables true -P model Fraktur_GT4HistOCR |
ocrd process "tesserocr-recognize -P segmentation_level region -P textequiv_level word -P find_tables true -P model GT4HistOCR_50000000.997_191951"
The following workflow has produced best results for 'simple' pages (e.g. this page) (CER ~1%).
Step | Processor | Parameter |
---|---|---|
1 | ocrd-cis-ocropy-binarize | |
2 | ocrd-anybaseocr-crop | |
3 | ocrd-skimage-binarize | -P method li |
4 | ocrd-skimage-denoise | P level-of-operation page |
5 | ocrd-tesserocr-deskew | -P level-of-operation page |
7 | ocrd-cis-ocropy-segment | -P level-of-operation page |
13 | ocrd-cis-ocropy-dewarp | |
14 | ocrd-calamari-recognize | -P checkpoint_dir qurator-gt4histocr-1.0 |
ocrd process \
"cis-ocropy-binarize -I OCR-D-IMG -O OCR-D-BIN" \
"anybaseocr-crop -I OCR-D-BIN -O OCR-D-CROP" \
"skimage-binarize -I OCR-D-CROP -O OCR-D-BIN2 -P method li" \
"skimage-denoise -I OCR-D-BIN2 -O OCR-D-BIN-DENOISE -P level-of-operation page" \
"tesserocr-deskew -I OCR-D-BIN-DENOISE -O OCR-D-BIN-DENOISE-DESKEW -P operation_level page" \
"cis-ocropy-segment -I OCR-D-BIN-DENOISE-DESKEW -O OCR-D-SEG -P level-of-operation page" \
"cis-ocropy-dewarp -I OCR-D-SEG -O OCR-D-SEG-LINE-RESEG-DEWARP" \
"calamari-recognize -I OCR-D-SEG-LINE-RESEG-DEWARP -O OCR-D-OCR -P checkpoint_dir qurator-gt4histocr-1.0"
Note:
(1) This workflow expects your images to be stored in a folder called OCR-D-IMG
. If your images are saved in a different folder,
you need to adjust -I OCR-D-IMG
in the second line of the call above with the name of your folder, e.g. -I MAX
(2) For the last processor in this workflow, ocrd-calamari-recognize
, you need to specify the model which is to be used.
If you didn't download it via the OCR-D resource manager, you have to use the checkpoint
parameter
and pass your local path to the model on your hard drive as parameter value! In this case, the last line of the ocrd-process
call above could e.g. look like this:
"calamari-recognize -I OCR-D-SEG-LINE-RESEG-DEWARP -O OCR-D-OCR -P checkpoint /test/data/calamari_models/\*.ckpt.json"
All the other lines can just be copied and pasted.
If your computer is not that powerful you may try this workflow. It works fine for simple pages and produces also good results in shorter time.
Step | Processor | Parameter |
---|---|---|
1 | ocrd-cis-ocropy-binarize | |
2 | ocrd-anybaseocr-crop | |
3 | ocrd-skimage-denoise | -P level-of-operation page |
5 | ocrd-tesserocr-deskew | -P level-of-operation page |
7 | ocrd-tesserocr-segment | -P shrink_polygons true |
13 | ocrd-cis-ocropy-dewarp | |
14 | ocrd-tesserocr-recognize | -P textequiv_level glyph -P overwrite_segments true -P model GT4HistOCR_50000000.997_191951 |
ocrd process \
"cis-ocropy-binarize -I OCR-D-IMG -O OCR-D-BIN" \
"anybaseocr-crop -I OCR-D-BIN -O OCR-D-CROP" \
"skimage-denoise -I OCR-D-CROP -O OCR-D-BIN-DENOISE -P level-of-operation page" \
"tesserocr-deskew -I OCR-D-BIN-DENOISE -O OCR-D-BIN-DENOISE-DESKEW -P operation_level page" \
"tesserocr-segment -I OCR-D-BIN-DENOISE-DESKEW -O OCR-D-SEG -P shrink_polygons true" \
"cis-ocropy-dewarp -I OCR-D-SEG -O OCR-D-SEG-DEWARP" \
"tesserocr-recognize -I OCR-D-SEG-DEWARP -O OCR-D-OCR -P textequiv_level glyph -P overwrite_segments true -P model GT4HistOCR_50000000.997_191951"
Note:
(1) This workflow expects your images to be stored in a folder called OCR-D-IMG
. If your images are saved in a different folder,
you need to adjust -I OCR-D-IMG
in the second line of the call above with the name of your folder, e.g. -I my_images
(2) For the last processor in this workflow, ocrd-tesserocr-recognize
, the environment variable TESSDATA_PREFIX has to be
set to point to the directory where the used models are stored if they are not in the default location. If you downloaded your models
with the OCR-D resource manager, this is already taken care of.
Welcome to the OCR-D wiki, a companion to the OCR-D website.
Articles and tutorials
- Running OCR-D on macOS
- Running OCR-D in Windows 10 with Windows Subsystem for Linux
- Running OCR-D on POWER8 (IBM pSeries)
- Running browse-ocrd in a Docker container
- OCR-D Installation on NVIDIA Jetson Nano and Xavier
- Mapping PAGE to ALTO
- Comparison of OCR formats (outdated)
- A Practicioner's View on Binarization
- How to use the bulk-add command to generate workspaces from existing files
- Evaluation of (intermediary) steps of an OCR workflow
- A quickstart guide to ocrd workspace
- Introduction to parameters in OCR-D
- Introduction to OCR-D processors
- Introduction to OCR-D workflows
- Visualizing (intermediate) OCR-D-results
- Guide to updating ocrd workspace calls for 2.15.0+
- Introduction to Docker in OCR-D
- How to import Abbyy-generated ALTO
- How to create ALTO for DFG Viewer
- How to create searchable fulltext data for DFG Viewer
- Setup native CUDA Toolkit for Qurator tools on Ubuntu 18.04
- OCR-D Code Review Guidelines
- OCR-D Recommendations for Using CI in Your Repository
Expert section on OCR-D- workflows
Particular workflow steps
Workflow Guide
- Workflow Guide: preprocessing
- Workflow Guide: binarization
- Workflow Guide: cropping
- Workflow Guide: denoising
- Workflow Guide: deskewing
- Workflow Guide: dewarping
- Workflow Guide: region-segmentation
- Workflow Guide: clipping
- Workflow Guide: line-segmentation
- Workflow Guide: resegmentation
- Workflow Guide: olr-evaluation
- Workflow Guide: text-recognition
- Workflow Guide: text-alignment
- Workflow Guide: post-correction
- Workflow Guide: ocr-evaluation
- Workflow Guide: adaptation-of-coordinates
- Workflow Guide: format-conversion
- Workflow Guide: generic transformations
- Workflow Guide: dummy processing
- Workflow Guide: archiving
- Workflow Guide: recommended workflows