Perfect OCR scanning for Android - android

Right now I'm making an OCR app using Android OCR rmtheis(https://github.com/rmtheis/android-ocr) as a scaffold.
However, I'm far from satisfied.
My main issues:
It returns only a fraction of the containing characters correct when scanning ultra-tiny texts with a few different fonts with
irrelavant clutter such as images and barcodes included (from a
product manual in this case).
The autofocus is looping in a way that if you press the camerabutton when the image is as it's sharpest shape, you might be
0.02 seconds too late and scan the blurry image. So I prefer an autocapture when text is included in the selected view.
Is there any high quality OCR solutions for Android that can capture tricky and small text and getting it all correct almost every time?
Just to clarifie: I use tesseract(tess-two) already through the android-ocr project
On another note: It needs to return close to 100% correct results almost everytime. No language support required, Im only going to use it to catch codes such as 842EAB842EAB842EAB84?2EAB842EAB842EAB with irrelevant english text besides it. Therefore, I need no language support at all.
Edit: This seems to be what I'm looking for:
http://www.abbyy.com/mobileocr/features/
Is there any solution with even higher quality output than Abbyy?

I've also been researching for high quality and free OCR solutions for Android, and finally I've chosen tess-two fork in one of my projects because other options had more disadvantages than advantages. As #realkarim says, it's not 100% accurate but the results are optimal.
Link for an OCR example using tess-two
Try it and comment us your experience ;)

Well, a year ago I was planning to create an Android application in which I needed an OCR, first of all and I'm sorry to say that but you won't find a free "high quality OCR solutions for Android" :/ I used tess-two which is the best free OCR available for android but still it wasn't 100% accurate, probably if I had more time I could add some image processing to enhance the output.
link for the OCR:
https://github.com/rmtheis/tess-two
an example of a running application using it:
http://www.youtube.com/watch?v=Ho5DyK1hKdw
my application:
http://www.youtube.com/watch?v=2PRQo7EWYd8
try it, and add some image processing to the image before using the OCR if you can :)

Related

Android find document in image

I'm fairly familiar with android application developpement and have created quite a few apps within Android-Studios. Now I'd like to do an app wich can detect a A4 paper in an image and read it's content. Can you name me a couple of libraries/API's? I've checked out OpenCV and Vuforia, but couldn't find something with this particular problem.
Thanks alot!
The best (free) possibility for OCR (Optical Character Recognition) would be Tesseract Engine.
Please note however, that you'll need some background in image processing to get reasonable results.
There are libraries that do the preprocessing for you, but most of them are commercial projects.

How to build OCR data for Android app with known layout and font

After trying several available eng.traineddata files with an Android app that employs Tesseract, I have less than stellar accuracy. Since my application will be using just a few fonts (font sizes, bold and regular), I thought I could get much better accuracy by building my own data. An example of the kind of thing (an 8.5x11 inch paper) that users will taking a picture of is here:
I have looked at jTessBoxEditor, but wondered if that was an appropriate path to investigate. And if so, I was unsure how to proceed with respect to a starting point, or to try from scratch. The font (which looks like Times New Roman) is very common, and didn't want to re-invent the wheel. I also wondered about how to treat the font on the two different color backgrounds.
Also, I wondered if I could just print-out ABC... abc... 123... in Times New Roman font and get that into a custom eng.traineddata file. If I understand correctly, you want the 'cleanest' data (i.e. no 'bad examples' of letters) in the source material used to train your system. But it would seem as if there would be a tutorial or procedure defined for how to build trained data for a specific font. If there is, it's been eluding me.
I would consider using machine learning, but so you don't have to do it on your own, look at Tensorflow Mobile. This is a version that is for mobile devices, and to help with character recognition you can look at this article.
To train any neural net a set of training data along with correct
outputs must be provided. In this case this will be a set of 128x64
images along with the expected output.
This will help you easily implement a solution to recognize the characters, and by going with this approach you can extend to more fonts if you desire by just doing more training.

how to read numbers and text from camera in android?

I'm working on android application and it should allow users to take photos using camera and the application reads the text and numbers in the photo.
I don't know where to start from android studio. is there any good suggestion on github that could help me???
thanks in advance.
As others said OpenCV or OCR is the way to go.
Google maintains one OCR library called as "Tesseract" (reminds me of Avengers :P).
To make the job little easier there is a fork of Tesseract called as Tess-Two
It combines some other useful tools like Leptonica (image processing library). Build instructions are given on the Readme file.
To get started you can check out very easy to use OCR library
Easy OCR Library Android which uses Tess-Two under the hood.
Again usage instructions are in the Readme file. It is already built so you don't need to build Tess-Two.
You can try to use OpenCV library. Its abbreviature is Open Computer Vision Library. It has a reputation similar to OpenGL. There must be articles about yor issue in which library is ised. It can be linked static or dynamic using runtime application called OpenCV Manager (available in Google Play). You can use it both in Java and C++ code. Hope, it helps
PS i have an own example of it use.
https://github.com/androidovshchik/ProhibitingSignDetector
i could give suggest about how i would do that if i needed to .
first of all you need to photo the picture only black and white .
then cheack the min black pixels in row that will define a letter .(you dont want any shadow to recognize as potential letter.
try and learn progress (any camera have diffrent resulution so it need to be some % of the picture row pixels.)
after that evrey letter have diffrent shape so you need to do for loop 5 times in diffrent angel until you get to the third gap of black rows.
after that some huge switch and if to get to the right letter need to do big research about the gap inside the letter proportion.
to have a little dataBase could help if you wanted to get more then one font .
again i not sure its the right way but that what i would do.
have fun :)
You may try to find some Optical Character Recognition (OCR) library for Java
Check Java OCR, tess-two, Aprise. And explore stackoverflow searching other OCR solutions.
Implementing your own OCR lib may be very difficult so think is it really necessary for your task.

Object Detection for android with tesseract or OpenCV

I have successfully integrated tesseract into my android app and it reads whatever the image that I capture but with very less accuracy. But most of the time I do not get the correct text after capturing because some text around the region of interest is also getting captured.
All I want to read is all text from a rectangular area, accurately, without capturing the edges of the rectangle. I have done some research and posted on stackoverflow about this two times, but still did not get a happy result!
Following are the 2 posts that I made:
https://stackoverflow.com/questions/16663504/extract-text-from-a-captured-image?noredirect=1#comment23973954_16663504
Extracting information from captured image in android
I am not sure whether to go ahead with tesseract or use openCV
Including the many links and answers from others, I think it's good to take a step back and note that there are actually two fundamental steps to optical character recognition (OCR):
Text Detection: This is the title and focus of your question, and it is concerned with localizing regions in an image that contain text.
Text Recognition: This is where the actual recognition happens, where the localized image regions from detection get segmented character-by-character and classified. This is also where tools like Tesseract come into play.
Now, there are also two general settings in which OCR is applied:
Controlled: These are images taken from a scanner or similar in-nature where the target is a document and things like perspective, scale, font, orientation, background consistency, etc are pretty docile.
Uncontrolled/Scene: These are the more natural and in-the-wild photos, e.g. those taken from a camera, where you are trying to recognize a street sign, shop name, etc.
Tesseract as-is is most applicable to the "controlled" setting. And in general, but for scene OCR especially, "re-training" Tesseract will not directly improve detection, but may improve recognition.
If you are looking to improve scene text detection, see this work; and if you are looking at improving scene text recognition, see this work. Since you asked about detection, the detection reference uses maximally stable extremal regions (MSER), which has a plethora of implementation resources, e.g. see here.
There's also a text detection project here specifically for Android too:
https://github.com/dreamdragon/text-detection
As many have noted, keep in mind that recognition is still an open research challenge.
The solution to improving the OCR output is to
either use more training data to train it better
filter it's input using some Linear Filter (grayscaling, high-contrasting, blurring)
In the chat we posted a number of links describing filtering techniques used in OCRing, but sample code wasn't posted.
Some of the links posted were
Improving input for OCR
How to train Tesseract
Text enhancement using asymmetric filters <-- this paper is easily found on google, and should be read fully as it quite clearly illustrates and demonstrates necessary steps before OCR-processing the image.
OCR Classification

android : using opencv for image recognition

I want my android app to recognise millions of images. So i want to know if openCv is a choice for this solution. I want an image to be compared against a huge ( millions ) of reference images and find if any matches . Is this can be achieved with efficiency when opencv is used
Depending upon the algorithm you're using the time varies.
Here's something about what you're asking. As Tushar stated it's better to do these computations on a server and return the results rather than on the client device. Although the code I'm going to post below showed tremendous speed on a Galaxy SIII.
Also, if you'd like some sample code, take a look here.

Categories

Resources