Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check image quality before OCR

I have android application that perform OCR on documents. I want to be able to make some test on the image before sending it to the server. so my question is if there's any tool/code available to measure the image focus before I send it to the server. I want to be able to know if the image not in focus(not sharp enough), to save the processing time from the server side and not to sent it. Thank's David

like image 829
BoazGarty Avatar asked Jun 04 '13 07:06

BoazGarty


People also ask

How do I know if my OCR is accurate?

Measuring OCR accuracy is done by taking the output of an OCR run for an image and comparing it to the original version of the same text. You can then either count how many characters were detected correctly (character level accuracy), or count how many words were recognized correctly (word level accuracy).

Why is the Tesseract OCR not accurate?

Inevitably, noise in an input image, non-standard fonts that Tesseract wasn't trained on, or less than ideal image quality will cause Tesseract to make a mistake and incorrectly OCR a piece of text.


1 Answers

David, that is a good question. Please share your findings for all of us as you collect more feedback.

I have used and have seen several techniques for this important step in processing. Reality is that it is MUCH easier to have user take a good picture, than to detect or correct a bed picture, which in many cases not even possible. So detection is nice to have, but that should not be the first action. There are so many options that can be triggered before image check, and I'll list a few below.

Techniques (technical and non-technical) that worked for me in the past, or worked for people I worked with or heard of:

  • Shake detection. Using the acceleration of the device to check for shaking at the time of taking the picture. Good approach, but works mostly in bright lighting. In dark environment, even with minimal shaking, picture can be easily smudged. This method has to be used in combination with other methods.

  • Binarization on device. Not only it allows you to compress and prepare the image for efficient transmission, it allows you to clearly see the quality of text. Looking at color image with dark backgrounds is not as obvious about sharpness of individual characters as looking at black-and-white edges of those characters.

  • Preview screen. Allow the user to see the picture they took and are about to submit. Frequently I see apps that allow to preview the picture, but have zoom disabled when I double-tap on it. Any text (even if it is bad) will look good on a tiny screen, because you cannot actually see the text.

  • I call it 'forced preview'. After taking the picture, and preferably after binarization, automatically zoom 10x and ask the user to confirm if they see sharp text or not. It seems invasive, so a good design is important here, but this method is reliable because it can be made as a required step.

  • Simple guided instructions on... How to take good pictures! Some apps show ti once at firstrun. Some apps give you chance to disable. In my apps, I have seen a substantial increase in quality after providing these instructions after update of my app FotoNote on iOS.

like image 96
Ilya Evdokimov Avatar answered Sep 28 '22 00:09

Ilya Evdokimov