-
Notifications
You must be signed in to change notification settings - Fork 60
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
Crash when returning result from image #1
Comments
I had exactly the same issue. Is there any way to solve this? It happens right after you take the picture. It tries to scan for a while, then crashes. That's my first time working with an OCR API, and I must say your code helped me a lot to have the basis. If you could tell how to go through this, it would be great. Thanks! |
I am having my exams. Will look into this after exams. If you write steps to reproduce it, that would be great. |
Thanks for your reply. I repeated all the steps carefully to run the app, and for some reason it works now. One thing I dont now how to deal with is the quality of the recognition and also the time spent, very long sometimes, and not returning a satisfactory result after it. Do you know how I could improve this? Thanks again. |
@gsiqueira Time spent depends on the quality of the image. Large image size means more time needed to process it. |
Yes, I tried some things to solve this problem, I reduced the size (640x460 and smaller) of the image taken, tried to binarize it, turn flash on, to improve brightness, but I still get the same result, which takes about one and two minutes to finish the process. The image I used to test has just 10 short lines, is this normal? I was looking at the code here, and I found the following: https://cloud.githubusercontent.com/assets/7751486/15730868/c7a96e24-2846-11e6-8c09-5de5607f2443.png It is strange, because android studio builds the app and it works. I am just showing you this because I don't know if it has something to do with my problem. Below you find the image I used and the best result I took. Thank you a lot for your attention in my problem. Source image Result |
Well the accuracy of OCR is not 100% accurate, at least this is the case for the ones those are open sourced. |
Hi, I had received exactly the same error. |
i have also issue.facing crash.Any solution priyankvex. logcat result: 01-02 00:54:02.801 19607-19607/com.wordpress.priyankvex.easyocrscanner E/WindowManager: Activity com.wordpress.priyankvex.easyocrscannerdemo.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{41f8c370 V.E..... R......D 0,0-304,96} that was originally added here |
From the original post... couldn't find "libpngt.so" I ran into this before. In Android studio, right click the module, select "Open Module Settings", click the "Dependencies" tab, remove the "easy_ocr_library", click "OK". Then right click the "easy_ocr_library" in your project, select "Open Module Settings" and remove the "easy_ocr_library" module by using the red "-". Close Android Studio then go to your folder that contains the "easy_ocr_library" and delete the whole "easy_ocr_library" folder and rebuild it from new. This doesn't solve the core problem but gets you back to where you were I've found. |
Facing the same issue. Any solution? Here is my log: 08-22 15:14:39.674 15432-16033/com.wordpress.priyankvex.easyocrscanner D/OcrScanner: tessdata already present |
Hi, I get the same error, while running in LG G3: 10-31 09:58:20.790 19999-22301/com.wordpress.priyankvex.easyocrscanner E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1 @gsiqueira |
Hi all, seems studio removes build directory, i fixed the problem by: |
Changing the dependency of easy_ocr_library module should solve the problem:
|
Still not working for me...!! Cannot resolve ImageProcessingThread |
Hi,
Building the sample app, I get the following crash when returning the image to the activity:
04-20 16:18:07.068 454-1975/com.wordpress.priyankvex.easyocrscanner E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1 Process: com.wordpress.priyankvex.easyocrscanner, PID: 454 java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:304) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) at java.util.concurrent.FutureTask.setException(FutureTask.java:222) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.wordpress.priyankvex.easyocrscanner-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]] couldn't find "libpngt.so" at java.lang.Runtime.loadLibrary(Runtime.java:366) at java.lang.System.loadLibrary(System.java:988) at com.googlecode.tesseract.android.TessBaseAPI.<clinit>(TessBaseAPI.java:43) at com.wordpress.priyankvex.easyocrscannerdemo.ImageProcessingThread.scanImage(ImageProcessingThread.java:142) at com.wordpress.priyankvex.easyocrscannerdemo.ImageProcessingThread.doInBackground(ImageProcessingThread.java:58) at com.wordpress.priyankvex.easyocrscannerdemo.ImageProcessingThread.doInBackground(ImageProcessingThread.java:26) at android.os.AsyncTask$2.call(AsyncTask.java:292) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) 04-20 16:18:07.838 454-454/com.wordpress.priyankvex.easyocrscanner E/WindowManager: android.view.WindowLeaked: Activity com.wordpress.priyankvex.easyocrscannerdemo.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{285963da V.E..... R......D 0,0-1368,464} that was originally added here at android.view.ViewRootImpl.<init>(ViewRootImpl.java:527) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:287) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:87) at android.app.Dialog.show(Dialog.java:325) at com.wordpress.priyankvex.easyocrscannerdemo.MainActivity.onOcrScanStarted(MainActivity.java:59) at com.wordpress.priyankvex.easyocrscannerdemo.ImageProcessingThread.onPreExecute(ImageProcessingThread.java:51) at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:591) at android.os.AsyncTask.execute(AsyncTask.java:539) at com.wordpress.priyankvex.easyocrscannerdemo.EasyOcrScanner.onImageTaken(EasyOcrScanner.java:44) at com.wordpress.priyankvex.easyocrscannerdemo.MainActivity.onActivityResult(MainActivity.java:46) at android.app.Activity.dispatchActivityResult(Activity.java:6808) at android.app.ActivityThread.deliverResults(ActivityThread.java:4698) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4745) at android.app.ActivityThread.access$1500(ActivityThread.java:197) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1730) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:6872) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
The text was updated successfully, but these errors were encountered: