Open GoogleCodeExporter opened 8 years ago
One thing I left to mention is that the IOException comes out where
in.read(bytes);..And the Exception will not occur when I use an image file in
the place of eng.traineddata file and everything runs OK.
Original comment by minthant...@gmail.com
on 24 Oct 2012 at 8:08
what's the packageResource in sentence:
InputStream in=packageResource.getAssets().open(DEFAULT_LANG+".traineddata");
I tried with
InputStream in=getAssets().open(DEFAULT_LANG+".traineddata");
and it turns out alright.
Original comment by xinton.B...@gmail.com
on 24 Oct 2012 at 9:27
I put all the above codes into only one function in a separate class so that I have to pass Resources() object (here packageResource) from main Activity() class into the function.... I've tried both with getResources().getAssets().open(DEFAULT_LANG+".traineddata"); and getResources().openRawResource(R.id.eng);. ...Both of them gave the same IOException() on calling the in.read(bytes) function.
Original comment by minthant...@gmail.com
on 25 Oct 2012 at 9:24
[deleted comment]
I've decided to put the "eng.trainedata" file bytes into an array of C++ file
and embed into the compiled library file.But the file size is more than 3MB.I
haven't tested but I'm worried about the performance issue.Any ideas please
help!
Original comment by minthant...@gmail.com
on 30 Oct 2012 at 9:39
You need to put your traineddata file in "asset/tessdata". Looks like thats
where you are trying to copy from.
1. I put the latest eng.traineddata file in the android "asset" folder
2. This is the code for copying the traineddata file from the "asset" folder to
the sd-card.
File tessdata=new File(DEFAULT_DATA_PATH+"tessdata/"+DEFAULT_LANG+".traineddata");
Original comment by Bibh...@gmail.com
on 19 Nov 2012 at 6:39
Original issue reported on code.google.com by
minthant...@gmail.com
on 24 Oct 2012 at 8:04