The purpose of this exercise was to see if OCR via Tesseract performs better/worse than the Vision API.
I have created a Jar for the Tesseract API (com.googlecode.tesseract.android.TessBaseAPI) by making use of this Github project. It took "ndk-build" about 30 minutes to create the .so files for 4 x CPU architect structures (armeabi, armeabi-v7a, mips, x86). The .so files are included in the TessTwo.jar that I have created.
I then created a shortcut wrap for this Github project. It brings nothing back to the B4A project - it will report the OCR result in a EditText view of the "shortcut" wrapped project. So, see how successful it is in OCR vs the Vision API. In my humble opinion:
1. It makes a massive APK although it allows for support of different languages. I have only allowed for English (see /Files/tessdata/eng.traineddata of the B4A project)
2. It seems to be slower than the Vision API in performing OCR
3. Accuracy vs the Vision API seems to be worse when making use of the camera to capture an image with text.
I have not yet tried to pass a bitmap with text to the TessBaseAPI to see if it performs better/worse than the Vision API. That will be my next exercise - probably by making use of some inline Java code so that I don't have to create another wrapper when making use of Tesseract OCR.
You can download the complete B4A project and lib files from here (a folder containing the complete B4A project and all the Jars and Xml files). Copy the Jars and XML files to your additional library folder. Make sure that you clean the project prior to compiling it (in B4A go Tools --> Clean project.
Link to the folder (or else click on "here" in the paragraph above):
https://drive.google.com/open?id=0B4g9tud5lvjgLXFZLThVVjFNaWs
I have created a Jar for the Tesseract API (com.googlecode.tesseract.android.TessBaseAPI) by making use of this Github project. It took "ndk-build" about 30 minutes to create the .so files for 4 x CPU architect structures (armeabi, armeabi-v7a, mips, x86). The .so files are included in the TessTwo.jar that I have created.
I then created a shortcut wrap for this Github project. It brings nothing back to the B4A project - it will report the OCR result in a EditText view of the "shortcut" wrapped project. So, see how successful it is in OCR vs the Vision API. In my humble opinion:
1. It makes a massive APK although it allows for support of different languages. I have only allowed for English (see /Files/tessdata/eng.traineddata of the B4A project)
2. It seems to be slower than the Vision API in performing OCR
3. Accuracy vs the Vision API seems to be worse when making use of the camera to capture an image with text.
I have not yet tried to pass a bitmap with text to the TessBaseAPI to see if it performs better/worse than the Vision API. That will be my next exercise - probably by making use of some inline Java code so that I don't have to create another wrapper when making use of Tesseract OCR.
You can download the complete B4A project and lib files from here (a folder containing the complete B4A project and all the Jars and Xml files). Copy the Jars and XML files to your additional library folder. Make sure that you clean the project prior to compiling it (in B4A go Tools --> Clean project.
Link to the folder (or else click on "here" in the paragraph above):
https://drive.google.com/open?id=0B4g9tud5lvjgLXFZLThVVjFNaWs
Last edited: