Tesseract 3.02 Training Automation Script

The Tesseract OCR Engine is a powerful open source text recognition engine, designed specifically for machine-printed text (fonts). Tesseract can be trained to both improve recognition accuracy, as well as teach it new languages. Training Tesseract is just another way of saying adding new fonts to tesseract. Training Tesseract 3.02 can be difficult for the novice though, as the official instructions are long and complex. We built a simple Python script to >somewhat< automate the Tesseract 3.02 language file build process.

How to use

Usage of this script assumes Python and Tesseract are both installed correctly on computer, and also that you have already generated your training text and box files. If you have not generated your training text yet, here is one of the simplest methods to do so:

  1. Collect image of text in TIF format - scan a sample document printed in the desired font, or create a new sample document
  2. Upload TIF to this online box editor, and correct any errors in character detection. Select the box file information from the right side of the tool, copy it to your clipboard, and paste it into a new blank text file. Save the textfile with the same name as the document image, but with a .box extension - for example, "scanned-image.box".
Save your training image and box file into the same directory as the training script, then running the following command:

python traininscript.py language fontname

Download

This project is hosted on GitHub, and can be downloaded there:

Download Tesseract Language File Generator at GitHub »

Changelog:
March 18, 2013: Original Release