Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use configuration variables in Tesseract?

I went through this tutorial successfully: Tesseract OCR Tutorial for iOS. It uses the Tesseract OCR iOS framework.

The app works well with the sample image provided by the tutorial, but none of my own images that I test work (the output is gibberish).

To troubleshoot, the docs recommend toggling a configuration variable tessedit_write_images to true (or using configfile get.images) to view the image file to be processed. But I don't see where to set the boolean value and I'm not sure where to place or how to use a configfile.

Search for "tessedit_write_images" in the files in Xcode don't return anything.

like image 512
Natalie Avatar asked Sep 06 '25 03:09

Natalie


1 Answers

You can set configuration variables either by providing as command line option or in a configuration file

Option 1: Using Command Line Parameter

$tesseract input.jpg output.txt --oem 2 -l eng -c tessedit_write_images=1

   -c configvar=value
       Set value for control parameter. Multiple -c arguments are allowed.

Option 2: Using Config File (myConfig)

$ tesseract Lord_Saraswathi.jpg text --oem 2 -l eng myConfig

$ cat myConfig
tessedit_write_images 1
like image 94
KJG Avatar answered Sep 07 '25 23:09

KJG