Closed GoogleCodeExporter closed 8 years ago
Sorry. I forgot to include the logcat details. Here they are:
10-06 16:33:46.921: VERBOSE/Tesseract(native)(18050):
Java_com_googlecode_tesseract_android_TessBaseAPI_nativeClassInit
10-06 16:33:46.921: VERBOSE/Tesseract(native)(18050):
Java_com_googlecode_tesseract_android_TessBaseAPI_nativeConstruct
10-06 16:33:46.931: VERBOSE/Tesseract(native)(18050):
Java_com_googlecode_tesseract_android_TessBaseAPI_nativeInit
10-06 16:33:46.931: INFO/Tesseract(native)(18050): Attempting Init() with
dir=/mnt/sdcard/tesseract/, lang=eng
10-06 16:33:47.041: INFO/Tesseract(native)(18050): Initialized Tesseract API
with language=eng
10-06 16:33:47.041: VERBOSE/Kishore(18050): Kishore:Accessed
10-06 16:33:47.041: DEBUG/dalvikvm(18050): Trying to load lib
/data/data/iitgn.ocr/lib/liblept.so 0x4601cdb8
10-06 16:33:47.041: DEBUG/dalvikvm(18050): Shared lib
'/data/data/iitgn.ocr/lib/liblept.so' already loaded in same CL 0x4601cdb8
10-06 16:33:47.041: DEBUG/AndroidRuntime(18050): Shutting down VM
10-06 16:33:47.041: WARN/dalvikvm(18050): threadid=1: thread exiting with
uncaught exception (group=0x400259f8)
10-06 16:33:47.051: ERROR/AndroidRuntime(18050): FATAL EXCEPTION: main
Original comment by kish...@iitgn.ac.in
on 6 Oct 2011 at 11:04
Well, I figured this out. It is not the nativeSetImagePix that wasnt being
accessed. There was a problem in reading the file in the readBitmap function
because the bitmap wasnt in the ARGB_8888 format.
This piece of code is required instead:
final TessBaseAPI baseApi = new TessBaseAPI();
baseApi.init(TESSBASE_PATH, DEFAULT_LANGUAGE);
// baseApi.setPageSegMode(TessBaseAPI.PSM_SINGLE_LINE);
BitmapFactory.Options opt = new BitmapFactory.Options();
opt.inPreferredConfig = Bitmap.Config.ARGB_8888;
final Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.digits, opt);
ImageView img = (ImageView) findViewById(R.id.imageView1);
img.setImageBitmap(bmp);
baseApi.setImage(bmp);
Original comment by kish...@iitgn.ac.in
on 6 Oct 2011 at 11:45
Original comment by alanv@google.com
on 11 Sep 2012 at 8:36
Check already exists in ReadFile.readBitmap().
Original comment by alanv@google.com
on 14 Sep 2012 at 6:37
Original issue reported on code.google.com by
kish...@iitgn.ac.in
on 6 Oct 2011 at 11:03