I'm working in a project that needs OCR offline. Made a small progress and decided to share here and get some feedback.
I've searched a little bit at this forum and google about it. Found options to use online OCR (NJDUDE's Lib or Erel's example). In the same project I also needs to manipulate some images and got DrewG Exemple about inline code to use JAVACV/OPENCV. This was the point to test Tesseract OCR in the same way (Inline code).
Downloaded the Lib at this link https://repo1.maven.org/maven2/org/bytedeco/javacpp-presets/1.0/javacpp-presets-1.0-bin.zip
More details about this can be found here.
Unzipped and copied the files I needed to my Additional Lib Folder.
The files I used: javacpp.jar, tesseract-android-arm.jar, leptonica-android-arm.jar, tesseract.jar, leptonica.jar
Coded Basic Example from bytedeco page. Made some changes to send the image as a file path to the image saved somewhere in the phone and got the "translation" text.
OBS: I needed to download tessdata files to my cell. Tried to add them to my app, but they were too big and I got some error deploying my app to cell (need to see this more carefully). The files to many languages can be found here or at google project page. I have download this one for my test example.
Here is the code I used. My test phone is a S4.
Hope it helps.
I've searched a little bit at this forum and google about it. Found options to use online OCR (NJDUDE's Lib or Erel's example). In the same project I also needs to manipulate some images and got DrewG Exemple about inline code to use JAVACV/OPENCV. This was the point to test Tesseract OCR in the same way (Inline code).
Downloaded the Lib at this link https://repo1.maven.org/maven2/org/bytedeco/javacpp-presets/1.0/javacpp-presets-1.0-bin.zip
More details about this can be found here.
Unzipped and copied the files I needed to my Additional Lib Folder.
The files I used: javacpp.jar, tesseract-android-arm.jar, leptonica-android-arm.jar, tesseract.jar, leptonica.jar
Coded Basic Example from bytedeco page. Made some changes to send the image as a file path to the image saved somewhere in the phone and got the "translation" text.
OBS: I needed to download tessdata files to my cell. Tried to add them to my app, but they were too big and I got some error deploying my app to cell (need to see this more carefully). The files to many languages can be found here or at google project page. I have download this one for my test example.
Here is the code I used. My test phone is a S4.
Hope it helps.
Attachments
Last edited: