bagumondigi / tesseract-android-tools

Automatically exported from code.google.com/p/tesseract-android-tools
1 stars 0 forks source link

Could not initialize Tesseract API with language=eng! #13

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Compile the library project
2. Copy language file eng.traineddata to expected location
3. Run the test project

What is the expected output? What do you see instead?
All unit tests should pass

What version of the product are you using? On what operating system?
Latest SVN of tesseract-android-tools with recommended library versions on 
Android 2.3.3

Please provide any additional information below.
In logact I can see the message "Could not initialize Tesseract API with 
language=eng". And the tests testInit and testGetUTF8Text fail.

Building went fine on Ubuntu 10.04 with Jenkins, then I copied the files to a 
Win 7 Machine and I run the test from here.

Original issue reported on code.google.com by till.klo...@gmail.com on 8 Sep 2011 at 10:59

GoogleCodeExporter commented 8 years ago
i have the same issue. oh,i take 3 days  on it

Original comment by xiaowang...@gmail.com on 21 Mar 2012 at 2:52

GoogleCodeExporter commented 8 years ago
My problem was probably that path to the language file was too long. I followed 
the android semantics for storing files on the sd-card (under data/packagename 
and so on), so I wound up with a pretty long path. Putting the file directly on 
the sdcard shortenend the path and everything works fine.

Original comment by till.klo...@gmail.com on 21 Mar 2012 at 8:01

GoogleCodeExporter commented 8 years ago

Original comment by alanv@google.com on 11 Sep 2012 at 8:31

GoogleCodeExporter commented 8 years ago
can anyone tell how this problem is fixed?

Original comment by nauman...@gmail.com on 25 Apr 2013 at 7:53

GoogleCodeExporter commented 8 years ago
i have got the same problem,i had searched so many materials on the 
internet,but it's still not fixed, who can tell me how to fix it.if you can 
,please send your solution to my gmail: yuxiaowoshia@gmail.com,thank you very 
much!

Original comment by yuxiaowo...@gmail.com on 9 Jan 2014 at 4:09

GoogleCodeExporter commented 8 years ago
Download the file from following location. Unzip it.
https://code.google.com/p/tesseract-ocr/downloads/detail?name=eng.traineddata.gz

OR

Use attached file.

Add it to storage memory.

And use following code to use file:

mTess = new TessBaseAPI();
        String datapath = Environment.getExternalStorageDirectory() + "/tesseract/";
        String language = "eng";
        File dir = new File(datapath + "tessdata/");
        if (!dir.exists()) 
            dir.mkdirs();
        mTess.init(datapath, language);

Original comment by ankitagr...@gmail.com on 18 Mar 2015 at 10:21

Attachments:

GoogleCodeExporter commented 8 years ago
#6 ankitagr...@gmail.com 's answer works for me. Thank you!

Original comment by isabellc...@gmail.com on 16 Jun 2015 at 9:18