Is there any free OCR library for Android?

144

92

I'm looking for a Java OCR that runs on Android, however Asprise doesn't seem to be a platform independent OCR. is there any opensource/free Java OCR I can use for android application development?

user121196

Posted 2009-07-09T20:13:34.737

Reputation: 11 255

Question was closed 2012-06-05T23:19:20.537

6This questioned should be reopened , It is a very important and valid question – Utsav Gupta – 2016-02-14T03:33:31.803

5

Google recently released an OCR API: https://developers.google.com/vision/text-overview

– Wirling – 2016-06-28T09:55:59.627

Answers

38

OCR can be pretty CPU intensive, you might want to reconsider doing it on a smart phone.

That aside, to my knowledge the popular OCR libraries are Aspire and Tesseract. Neither are straight up Java, so you're not going to get a drop-in Android OCR library.

However, Tesseract is open source (GitHub hosted infact); so you can throw some time at porting the subset you need to Java. My understanding is its not insane C++, so depending on how badly you need OCR it might be worth the time.

So short answer: No.

Long answer: if you're willing to work for it.

Kevin Montrose

Posted 2009-07-09T20:13:34.737

Reputation: 16 785

13I would recommend trying to wrap Tesseract in a JNI layer through Android NDK, rather than trying to port it to Android's Java. Tesseract already appears to be ported to ARM, so it should be easier to put a JNI API on top of it. Also, this keeps it fast(er) than any Java port would be, and would simplify long-term maintenance. – CommonsWare – 2009-09-21T19:00:33.043

15

There is already a Tesseract JNI interface for Java called Tessjeract. http://code.google.com/p/tesjeract/

– sventechie – 2009-12-04T19:21:58.007

1Tesseract will not be a short walk from C to java. The code I've seen is highly idiomatic 80's C and not easily transportable to other languages. – plinth – 2009-12-21T15:16:07.773

1WARNING ! Asprise can't run on android, it uses swing... – Taiko – 2014-11-26T09:14:43.557

@sventechie No sign to be found of TessJeRact on the web nowadays (correct URL probably was http://code.google.com/p/tessjeract (with ss).

– ᴠɪɴᴄᴇɴᴛ – 2015-05-19T14:28:34.380

2

@vincent disappeared in the last year. JNA version is now available: https://github.com/nguyenq/tess4j but also an Android fork: https://github.com/rmtheis/tess-two

– sventechie – 2015-05-22T16:06:51.927

2by porting it over do you mean rewriting the subset in Java? that might take lots of effort, so there is not a 100% Java OCR out there? – user121196 – 2009-07-10T00:39:46.807

To the best of my knowledge, no there is not. – Kevin Montrose – 2009-07-10T06:13:55.787

21

I am having quite a lot of luck with tesseract-android-tools

Ben Pearson

Posted 2009-07-09T20:13:34.737

Reputation: 5 080

The question has been closed, but it's good to find someone who has had positive results. It's very hard to find people on these sourceforge type projects. Question: did you try Tesseract with image scans of passports or ID documents? It seems ok with text PDFs but I'm struggling with images. – PKHunter – 2014-09-02T01:56:06.863

I didn't try it with anything that had images on, it was just a document with text (same font, typeface, size) – Ben Pearson – 2014-09-02T13:36:10.820

I hope it works for me – Romantic Electron – 2014-11-28T20:38:09.880

20

ANother option could be to post the image to a webapp (possibly at a later moment), and have it OCR-processed there without the C++ -> Java port issues and possibly clogging the mobile CPU.

Jaco

Posted 2009-07-09T20:13:34.737

Reputation: 249

very good idea :D I assume you meant a web service (asmx) thanks – Omidoo – 2013-01-01T21:06:24.440

7

Google Goggles is the perfect application for doing both OCR and translation.
And the good news is that Google Goggles to Become App Platform.

Until then, you can use IQ Engines.

harrymc

Posted 2009-07-09T20:13:34.737

Reputation: 743

4

Yes there is.

But OCR is very vast. I know an Android application that has an OCR feature, but that might not be the kind of OCR you are looking after.

This open-source application is called Aedict, and it does OCR on handwritten Japanese characters. It is not that slow.

If it is not what you are looking for, please precise which kind of characters, and which data input (image or X-Y touch history).

Nicolas Raoul

Posted 2009-07-09T20:13:34.737

Reputation: 33 391

2

You can use the google docs OCR reader.

richardwiden

Posted 2009-07-09T20:13:34.737

Reputation: 1 426

1Not relevant link to the documentation – Volodymyr Khodonovych – 2016-11-15T09:47:13.163

Posted this answer on another question which was marked as a duplicate of this one so I thought I might aswell post it here – richardwiden – 2011-09-13T14:24:06.617