How to improve image quality for OCR reader in Android - android

I've made an app which uses the phone's camera to take a photo and then parses this photo (with Tesseract OCR) into a string.
The problem is that the string I obtain is very ugly, it contains wrong or unreadable characters.
I've read here that a filter to reduce image's noise may improve OCR's result. I've googled some of them and I've found this website which contains a lot of image filters written in Java. The issue is that they use BufferedImage class, which is not in Android SDK.
Does anyone know any other library which performs this operation in android?

You should use Bitmap. https://developer.android.com/reference/android/graphics/Bitmap.html
It's the equivalent (in theory, not in api) with BufferedImage.
Chek this post too:
How to load BufferedImage in android?

Related

Retrieving Pixels from a DNG file within Android

I am currently working on an HDR application that requires the use of Camera2 to be able to customize HDR settings.
I have developed a customized algorithm to retrieve certain data from Raw DNG images and I would like to implement it on Android.
I am unfortunately not an expert in Java/Android, so I taught myself how to code. Using other formats, I have usually worked with bitmaps to retrieve pixel data. ( which was relatively an easy task concerning the existing methods )
Concerning DNG files, I have found no documentation showing me how to retrieve the pixels data. I thought of bufferizing the image, however the DNG file format contains many information other than pixels and I'm afraid I am unable to find an extraction strategy using bufferstream. (I just want to store the pixels inside an array)
Anyone has an idea ? Would highly appreciate some tips.
Best regards
Camera2 does not produce DNGs directly - it produces plain RAW buffers, which you can then save to a DNG via DngCreator.
Are you operating on the initial RAW buffers, or saving DNGs and then loading them back?
In general, DNGs are not full baked images, so quite a bit of code is needed to render them completely - see for example Adobe's DNG SDK.

Opencv with Android- OCR

I want to do OCR for Sindhi, in an Android application, the idea is to let the person write on screen and then capture up the frame and then compare it with the images of the words pre saved in the mobile, and the image that matches up the most(using FLANN?) with the frame would have some text against it, and I just want to pronounce that text then. So please tell me if my approach is wrong, as I am new to Android and OpenCV both, or else tell me how do I start?
If I understand well your aim, you want to compare the text written on the screen of the mobile with images where text is present, right?
I've done a bit of OCR on Android and I used OpenCV and Tesseract.
Tesseract is a real OCR engine but you need to have images that are as "clean" as possible. That's why you need OpenCV to clean them up before using Tesseract.
OpenCv for Android : http://opencv.org/platforms/android.html
Tesseract for Android : https://github.com/rmtheis/tess-two
So to give you the main lines of my workflow for a similar application :
Grab the text written by the user in a string or an array of strings.
Go fetch your pre-saved images
Process them through OpenCV, OpenCV is mainly used here to clean the images by getting rid of noise especially. You should try using a Glaussian Blur, then an Adaptive Threshold and a Bitwise-NOT (OCR engines deal better with black and white images that you obtain with the Bitwise-NOT)
After you get some clean images with OpenCV, process these images through Tesseract. That will give you a string for each image that contains the detected text on the images.
Compare your different strings gathered on Tesseract with the user's text by parsing each word to find out the text that matches the best.
For the audio part of your app, I'm not sure how to proceed, they must be some libraries out there that might help.
You must be aware that using all these libraries on Android is quite a struggle, you might have problems with the build of the project, follow well the different documentation that is provided on the official websites.

Tesseract OCR read ID for Android

Im trying to implement tesseract (tess-two) to read data of one ID or check. Could someone have done it? I am having problems at the time to recognize the text. The result have a lot of extra characters
In my experience with Tesseract OCR, I have found that I get much better results if I convert the image to byte binary (pixels are either black or white). The OCR engines tend to work better when there is high contrast. For information about how to convert Android Bitmaps to binary images, take a look at this question (Android: Convert Grayscale to Binary Image).
This link explains why black and white images tend to work better, and also talks about other ways to improve OCR accuracy (https://marinersoftware.deskpro.com/kb/articles/294-which-steps-can-be-taken-to-improve-the-accuracy-of-ocr-results-in-paperless).
While pre-processing the input image will improve accuracy, it may also be helpful to post-process the output text.

Image recognition convert an image to text in android

I am now currently doing a project on image to text convertion, i have go through various process like canny algorithm and so many, but did not get a solution.Finally i got a video in the following link here
i need exactly the same application now how can i implement this please find me a solution
I believe you want to recognize the characters from a picture, here are some related posts
Is there any free OCR library for Android?
What kind of OCR Java library should I use in Android?
Proof-of-concept word input from camera for Android
http://code.google.com/p/wordsnap-ocr/

Displaying modified live camera preview

I've currently made an android app that can display a live preview of the camera, but I'm looking for a way to perform live pixel manipulation (ie, make the image grayscale, sepia-toned, etc.). As of yet I haven't found any code for someone whose done this before.
Any help would be appreciated.
You could use the Camera.Parameters to set the appropriate effect. Read more about it here.
If you want to do the manipulation by yours then use onPreviewFrame of camera. This gives you raw byte[] of YUV format (its by default, you could set it to other formats also. Look here for setting the preview format).
Now you could able to perform any pixel manipulation you want on byte[].
Hope this helps!
I have answered this question here. In short, this tutorial gives you probably the best way, how to achieve this (by using OpenCV, a free Computer Vision library). You can download their example application from their website as well.

Categories

Resources