combine_tessdata (1) - Linux Man Pages
combine_tessdata: combine/extract/overwrite Tesseract data
combine_tessdata - combine/extract/overwrite Tesseract data
combine_tessdata(1) is the main program to combine/extract/overwrite tessdata components in [lang].traineddata files.
To combine all the individual tessdata components (unicharset, DAWGs, classifier templates, ambiguities, language configs) located at, say, /home/$USER/temp/eng.* run:
The result will be a combined tessdata file /home/$USER/temp/eng.traineddata
Specify option -e if you would like to extract individual components from a combined traineddata file. For example, to extract language config file and the unicharset from tessdata/eng.traineddata run:
combine_tessdata -e tessdata/eng.traineddata \ /home/$USER/temp/eng.config /home/$USER/temp/eng.unicharset
The desired config file and unicharset will be written to /home/$USER/temp/eng.config /home/$USER/temp/eng.unicharset
Specify option -o to overwrite individual components of the given [lang].traineddata file. For example, to overwrite language config and unichar ambiguities files in tessdata/eng.traineddata use:
combine_tessdata -o tessdata/eng.traineddata \ /home/$USER/temp/eng.config /home/$USER/temp/eng.unicharambigs
As a result, tessdata/eng.traineddata will contain the new language config and unichar ambigs, plus all the original DAWGs, classifier templates, etc.
Note: the file names of the files to extract to and to overwrite from should have the appropriate file suffixes (extensions) indicating their tessdata component type (.unicharset for the unicharset, .unicharambigs for unichar ambigs, etc). See k*FileSuffix variable in ccutil/tessdatamanager.h.
Specify option -u to unpack all the components to the specified path:
combine_tessdata -u tessdata/eng.traineddata /home/$USER/temp/eng.
-e .traineddata FILE...: Extracts the specified components from the .traineddata file
-o .traineddata FILE...: Overwrites the specified components of the .traineddata file with those provided on the comand line.
The components in a Tesseract lang.traineddata file as of Tesseract 3.02 are briefly described below; For more information on many of these files, see m[blue]https://github.com/tesseract-ocr/tesseract/wiki/TrainingTesseractm
- (Optional) Language-specific overrides to default config variables.
- (Required) The list of symbols that Tesseract recognizes, with properties. See unicharset(5).
- (Optional) This file contains information on pairs of recognized symbols which are often confused. For example, rn and m.
- (Required) Character shape templates for each unichar. Produced by mftraining(1).
- (Required) The number of features expected for each unichar. Produced by mftraining(1) from .tr files.
- (Required) Character normalization prototypes generated by cntraining(1) from .tr files.
- (Optional) A dawg made from punctuation patterns found around words. The "word" part is replaced by a single space.
- (Optional) A dawg made from dictionary words from the language.
- (Optional) A dawg made from tokens which originally contained digits. Each digit is replaced by a space character.
- (Optional) A dawg made from the most frequent words which would have gone into word-dawg.
- (Optional) Several dawgs of different fixed lengths --- useful for languages like Chinese.
- (Optional) A unicharset for cube, if cube was trained on a different set of symbols.
- (Optional) A word dawg for cube's alternate unicharset. Not needed if Cube was trained with Tesseract's unicharset.
- (Optional) When present, a shapetable is an extra layer between the character classifier and the word recognizer that allows the character classifier to return a collection of unichar ids and fonts instead of a single unichar-id and font.
- (Optional) A dawg of word bigrams where the words are separated by a space and each digit is replaced by a ?.
- (Optional) TODO: Describe.
- (Optional) TODO: Describe.
combine_tessdata(1) first appeared in version 3.00 of Tesseract
The Tesseract OCR engine was written by Ray Smith and his research groups at Hewlett Packard (1985-1995) and Google (2006-present).