简体   繁体   English

android和tesseract ocr错误

[英]android and tesseract ocr error

I'm getting this error while debugging android OCR app 调试android OCR应用程序时出现此错误
the log is : (you can see the error at the last few lines) 日志是:(您可以在最后几行看到错误)

12-27 16:18:01.050: D/TextLayoutCache(4953): Using debug level: 0 - Debug Enabled: 0
12-27 16:18:01.150: D/memalloc(4953): /dev/pmem: Mapped buffer base:0x5c266000             size:16297984 offset:12529664 fd:62
12-27 16:18:01.650: D/memalloc(4953): /dev/pmem: Mapped buffer base:0x5d2f1000 size:20066304 offset:16297984 fd:65
12-27 16:18:02.150: D/memalloc(4953): /dev/pmem: Mapped buffer base:0x5e614000 size:10739712 offset:6971392 fd:68
12-27 16:18:03.910: V/SimpleAndroidOCR.java(4953): Starting Camera app
12-27 16:18:04.310: D/memalloc(4953): /dev/pmem: Unmapping buffer base:0x5c266000 size:16297984 offset:12529664
12-27 16:18:04.310: D/memalloc(4953): /dev/pmem: Unmapping buffer base:0x5e614000 size:10739712 offset:6971392
12-27 16:18:04.320: D/memalloc(4953): /dev/pmem: Unmapping buffer base:0x5d2f1000 size:20066304 offset:16297984
12-27 16:18:05.230: W/IInputConnectionWrapper(4953): showStatusIcon on inactive InputConnection
12-27 16:18:15.730: I/SimpleAndroidOCR.java(4953): resultCode: -1
12-27 16:18:15.770: D/dalvikvm(4953): GC_FOR_ALLOC freed 67K, 7% free 12729K/13599K, paused 33ms
12-27 16:18:15.770: I/dalvikvm-heap(4953): Grow heap (frag case) to 15.359MB for 3000016-byte allocation
12-27 16:18:15.800: D/dalvikvm(4953): GC_FOR_ALLOC freed 4K, 6% free 15654K/16547K, paused 18ms
12-27 16:18:15.830: D/dalvikvm(4953): GC_CONCURRENT freed <1K, 6% free 15654K/16547K, paused 2ms+2ms
12-27 16:18:16.080: V/SimpleAndroidOCR.java(4953): Orient: 6
12-27 16:18:16.080: V/SimpleAndroidOCR.java(4953): Rotation: 90
12-27 16:18:16.100: D/dalvikvm(4953): GC_FOR_ALLOC freed 37K, 6% free 15629K/16547K, paused 20ms
12-27 16:18:16.110: I/dalvikvm-heap(4953): Grow heap (frag case) to 18.191MB for 3000016-byte allocation
12-27 16:18:16.180: D/dalvikvm(4953): GC_FOR_ALLOC freed <1K, 5% free 18559K/19491K, paused 56ms
12-27 16:18:16.240: D/dalvikvm(4953): GC_CONCURRENT freed 0K, 5% free 18559K/19491K, paused 2ms+2ms
12-27 16:18:16.270: D/dalvikvm(4953): GC_FOR_ALLOC freed 2930K, 20% free 15629K/19491K, paused 13ms
12-27 16:18:16.270: I/dalvikvm-heap(4953): Grow heap (frag case) to 18.191MB for 3000016-byte allocation
12-27 16:18:16.310: D/dalvikvm(4953): GC_FOR_ALLOC freed <1K, 5% free 18558K/19491K, paused 25ms
12-27 16:18:16.330: V/SimpleAndroidOCR.java(4953): Before baseApi  
(THE ERROR STARTS HERE)
12-27 16:18:16.330: W/dalvikvm(4953): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/googlecode/tesseract/android/TessBaseAPI;  
12-27 16:18:16.330: D/AndroidRuntime(4953): Shutting down VM
12-27 16:18:16.330: W/dalvikvm(4953): threadid=1: thread exiting with uncaught exception (group=0x40ab3210)
12-27 16:18:16.340: E/AndroidRuntime(4953): FATAL EXCEPTION: main

the .java file : .java文件:

    Log.v(TAG, "Before baseApi");

// the error starts from here

    TessBaseAPI baseApi = new TessBaseAPI();
    baseApi.setDebug(true);
    baseApi.init(DATA_PATH, lang);
    baseApi.setImage(bitmap);

    String recognizedText = baseApi.getUTF8Text();

    baseApi.end();

    // the next line is not exist in the log

    Log.v(TAG, "OCRED TEXT: " + recognizedText);

If you knows what this exception for please advice me .... thank you 如果您知道此异常的原因,请给我建议....谢谢

问题是调试项目之前使用ndk-build命令,我成功重建了项目,问题消失了,谢谢您的帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM