Limit characters tesseract is looking for

Danilo Bargen picture Danilo Bargen · Mar 2, 2010 · Viewed 82.8k times · Source

Is it possible to limit the set of characters that tesseract is looking for (e.g. search only for letters a-z)? That would improve my results greatly.

Answer

Blomman picture Blomman · Jun 6, 2010

Create a config file (e.g "letters") in tessdata/configs directory - usually /usr/share/tesseract/tessdata/configs
or
/usr/share/tesseract-ocr/tessdata/configs

And add this line to the config file:

tessedit_char_whitelist abcdefghijklmnopqrstuvwxyz  

...or maybe [a-z] works.. dunno :-)
Then call tesseract similar to this:

tesseract input.tif output nobatch letters  

That will limit tesseract to recognize only the wanted characters