Tesseract OCR read ID for Android - 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.

Related

How to improve image quality for OCR reader in 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?

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.

Android efficient storage of two images which are similar

Application size on a phone needs to be as small as possible. If I have an image of a sword and then a very similar image of that same sword except that I've changed the color or added flames or changed the picture of the jewel or whatever, how do store things as efficiently as possible?
One possibility is to store the differences graphically. I'd store just the image differences and then combine the two images at runtime. I've already asked a question on the graphic design stackexchange site about how to do that.
Another possibility would be that there is that apk already does this or that there is already a file format or method people use to store similar images in android.
Any suggestions? Are there tools that I could use to take two pngs and generate a difference file or a file format for storing similar images or something?
I'd solve this problem at a higher level. For example, do the color change at run-time (maybe store the image with a very specific color like some ugly shade of green that you know is the color to be fixed at run-time with white or red or blue or whatever actual color you want). Then you could generate several image buffers at load-time.
For compositing the two images, just store the 'jewel' image separately, and draw it over the basic sword. Again, you could create a new image at load-time, or just do the overdraw at run-time.
This will help reduce your application's footprint on flash, but will not reduce the memory footprint when the app is active.
I believe your idea of storing the delta between 2 images to be quite good.
You would then compress the resulting delta file with a simple entropy coder, such as Huffman, and you are pretty likely to achieve a strong compression ratio if similarities with base image are important.
If the similarity are really very strong, you could even try a Range Coder, to achieve less-than-one-bit-per-pixel performance. The difference however might be noticeable only for larger images (i.e higher definition than a 12x12 sprite).
These ideas however will require you or someone to write for you such function's code. This should be quite straightforward.
An very easy approach to do this is to use an ImagePack ( one image containing many ) - so you can easy leverage the PNG or JPG compression algorithms for your purpose. You then split the images before drawing.

Library to identifying the similarity between 2 image in android

Suggestions on the best (preferably easiest way) to compare two images in android.
The first image is in my SD Card.
The second image was taken using Camera in android.
How to measure percentage similarity between those 2 images??
Thanks a lot.
Android does not provide any picture comparison algorithms for you.
Therefore, you will need to write one yourself - one that fits your needs, since not all image comparison algorithms/techniques are the same, and some work better in some cases than others.
You might want to start by looking at the SIFT technique, and find an image matching algorithm that suits your requirements.

Categories

Resources