amirrajan / rubymotion-applied

RubyMotion documentation provided by the community. Submit a pull request to the docs for a free one year indie subscription.
Apache License 2.0
50 stars 9 forks source link

Some kind of how-to for using Tesseract-OCR #14

Open amirrajan opened 7 years ago

amirrajan commented 7 years ago

https://github.com/gali8/Tesseract-OCR-iOS/wiki/Installation#importing-the-tessdata-folder

Siggs2000 commented 7 years ago

I think I've figured it out. I put the tessdata folder in /resources and followed the data file solution form this github issue: https://github.com/gali8/Tesseract-OCR-iOS/issues/299

I also added the english language "cube data" from this repo: https://github.com/tesseract-ocr/tessdata/tree/bf82613055ebc6e63d9e3b438a5c234bfd638c93

And then finally I initialized the library to use CubeCombined mode when initializing the library. Here is my initialization code:

   tesseract = G8Tesseract.alloc.initWithLanguage("eng")
    tesseract.delegate = self
    tesseract.engineMode = G8OCREngineModeTesseractCubeCombined
    tesseract.pageSegmentationMode = G8PageSegmentationModeAutoOSD