Skip to content Skip to sidebar Skip to footer

Android Tesseract Progress Callback

So I finally managed to get the Android Tesseract Tools to compile. Everything works as expected, except I wouldn't mind some sort of progress call back. I looked in the wrapper cl

Solution 1:

First off, since the OCR process can be deemed as a "long running task" in the grand sceme of things, put it into an async task. Things such as I/O, network, or image processing should be put into an async task, as you don't want this running on the main UI thread. If a user has a really low spec phone, it would take some time and eventually cause an application not responding error if you leave it on the main UI thread.

In regards to progress bars, you have a few options. If you have a finite time limit such as 30 seconds then set the progress to work up to that and finish early if the OCR process is quicker than 30 seconds. You can also tap into the underlying native code, but its probably not worth the effort...

Alternatively, and the optimal approach in my opinion, set a circular spinner for the duration of the OCR process, since the images could be different and you don't really have an idea how long it will take.


Post a Comment for "Android Tesseract Progress Callback"