Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tesseract can't open trained data #55

Closed
golergka opened this issue Sep 20, 2014 · 14 comments
Closed

Tesseract can't open trained data #55

golergka opened this issue Sep 20, 2014 · 14 comments
Labels

Comments

@golergka
Copy link

I've created new project with CocoaPods and Tesseract and load the tesseract

Error opening data file /var/mobile/Applications/8900B20E-746E-445B-A328-575C94E50CA6/check.app/tessdata/eng.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory.
Failed loading language 'eng'
Tesseract couldn't load any languages!

Here's the code:

class ViewController: UIViewController, TesseractDelegate {

    var tesseract : Tesseract?

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        tesseract = Tesseract(language: "eng")
        tesseract!.delegate = self
    }

Of couse, I indeed have tessdata folder inside my project folder, and there's eng.traineddata file there as well,

@ws233
Copy link
Collaborator

ws233 commented Oct 1, 2014

Did you check the path and a file, which you told about?
It seems, the file is located in a wrong path or corrupted.

@kevincon
Copy link
Collaborator

@golergka, I experienced this issue as well, and it was because my "tessdata" folder was a symbolic group in Xcode instead of a referenced folder. You'll know if you have it right if the "tessdata" folder has a blue icon. It won't work if the icon is a yellow folder.

Here's a screenshot of what your project structure should look like:

screen shot 2014-10-10 at 1 18 47 pm

@flooie
Copy link

flooie commented Nov 25, 2014

Thank you @kevincon

@zachberger
Copy link
Collaborator

@golergka, it seems that this is resolved. If not please reopen this issue. Thanks

@Ithoughts
Copy link

I go through the same error 'Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory.' When I try to change the eng.traineddata to chi_sim.traineddata.What the mistake I have made?

@ws233
Copy link
Collaborator

ws233 commented May 13, 2015

@Ithoughts, That means, that tesseract can not see you traineddata files.
So the reasons could be:

  1. You put them in a wrong folder. The corret place to put is explained above.
  2. You missed some files. There could be more than one file necessary for you language.
  3. You chose wrong version of traineddata files. The current tesseract core version is 3.0.x. That means you should try the same version of traineddata files.
    Pls, check all the above and let us know if that's fixed your issue.

@Ithoughts
Copy link

@ws233 I have put them in a right folder and chose the right version of traineddata files.As you concerned,'You missed some files. There could be more than one file necessary for you language.',I wonder what files I have missed,what files are necessary?How to generate the indeed files?Thanks!

@ws233
Copy link
Collaborator

ws233 commented May 14, 2015

There is a very detailed page about training tesseract: https://code.google.com/p/tesseract-ocr/wiki/TrainingTesseract3. But before you jump into this, could you provide your traineddata files, specify the path, where you put them and show a code snippet, which you use to run tesseract?

@Ithoughts
Copy link

@ws233 I just put the chi_sim.traineddata into the tessdata file,but its recognition is horrible.how can I improve the recognition of Chinese?What can I do ?Please give me a detailed tip,thanks a lot!

@tarungarg
Copy link

Download eng.traineddata from Google
$ wget https://tesseract-ocr.googlecode.com/files/eng.traineddata.gz

Then just move it into the ../tessdata/

$ gunzip eng.traineddata.gz
$ sudo mv -v eng.traineddata ../tessdata/

@FattigerTao
Copy link

@kevincon thank you.

@hungnmai
Copy link

hungnmai commented Jul 3, 2017

how to the "tessdata" folder has a blue icon

@Paul95278
Copy link

@Ithoughts I have the same problem as you now, have you worked out it,? So, could you give me some advices, thanks!

@jdawg844
Copy link

jdawg844 commented Sep 24, 2017

how do you move the eng.traineddata to tessdata on mac OS?
i have tessdata and eng.traineeddata but i get this result.

"mv: rename eng.traineddata to ../tessdata/: No such file or directory"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests