priyankvex / easy-ocr-scanner-android Goto Github PK
View Code? Open in Web Editor NEWEasiest and simplest OCR scanner library for Android built using Tesseract and Leptonica.
Easiest and simplest OCR scanner library for Android built using Tesseract and Leptonica.
Is there algorithm or process to Isolate the text from the background to make better performance?
app crash while "onOcrScanFinished(Bitmap bitmap, String recognizedText)".
any solution to this??
please add a dependency so it will be easier to import the library and also I tried adding the directory (after downloading) but it is still not working.
here is error code
09-01 16:46:25.741 30807-30807/com.wordpress.priyankvex.easyocrscanner E/WindowManager: android.view.WindowLeaked: Activity com.wordpress.priyankvex.easyocrscannerdemo.MainActivity has leaked window com.android.internal.policy.PhoneWindow$DecorView{a00872a V.E...... R......D 0,0-1002,348} that was originally added here
at android.view.ViewRootImpl.(ViewRootImpl.java:603)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:326)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:109)
at android.app.Dialog.show(Dialog.java:505)
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:604)
at android.os.AsyncTask.execute(AsyncTask.java:551)
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:7165)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4994)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:5041)
at android.app.ActivityThread.access$1600(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1875)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
09-01 16:46:25.741 30807-30807/com.wordpress.priyankvex.easyocrscanner D/ViewRootImpl: #3 mView = null
09-01 16:47:01.211 30807-30813/com.wordpress.priyankvex.easyocrscanner W/art: Suspending all threads took: 53.012ms
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)
This is the worst example on how to use a library. No examples provided
java.lang.SecurityException: Permission Denial: starting Intent { act=android.media.action.IMAGE_CAPTURE flg=0x3 cmp=android/com.android.internal.app.ResolverActivity clip={text/uri-list U:file:///storage/emulated/0/EasyOcrScanner/1525235581304.jpg} (has extras) } from ProcessRecord{ab4ef9d 24823:com.example.umangthakkar.electrofycustomer/u0a200} (pid=24823, uid=10200) with revoked permission android.permission.CAMERA
Please give the solution
possible to gather all text results at once from all containers?
I would like to get some help if possible . I'm trying to detect business card using my Android phone camera but I don't know where to start. so i can Extracting text from image using OCR and process it to read business card..
error logs :
2019-07-17 16:45:32.279 29896-30962/com.wordpress.priyankvex.easyocrscanner E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.wordpress.priyankvex.easyocrscanner, PID: 29896
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:353)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.wordpress.priyankvex.easyocrscanner-4lBy6g5noZ6py42LHcxdeQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.wordpress.priyankvex.easyocrscanner-4lBy6g5noZ6py42LHcxdeQ==/lib/arm, /system/lib, /system/vendor/lib]]] couldn't find "liblept.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1011)
at java.lang.System.loadLibrary(System.java:1657)
at com.googlecode.tesseract.android.TessBaseAPI.<clinit>(TessBaseAPI.java:44)
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:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.