9951 explained code solutions for 126 technologies


tesseract-ocrHow do I install and use language packs with Tesseract OCR?


  1. Download the language pack of your choice from the Tesseract OCR language packs repository.
  2. Extract the language pack files to the tessdata directory. On Linux, this is usually /usr/share/tesseract-ocr/4.00/tessdata/
  3. Use the -l parameter in the Tesseract command line to specify the language you want to use. For example, tesseract input.jpg output -l deu
  4. To verify that the language pack has been loaded, you can use the --list-langs command. This will output a list of all the languages available to Tesseract.

Example code

tesseract input.jpg output -l deu
tesseract --list-langs

Example output:

List of available languages (2):
deu
eng

Helpful links

Edit this code on GitHub