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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With