Check image quality before OCR

I have an Android app that runs OCR on documents. I want to do some tests on the image before sending it to the server. so my question is is there any tool / code to measure image focus before sending to the server. I want to know if the image is in focus (not sharp enough) to save the processing time from the server side, and not send it. Thanks David

+6
source share
1 answer

David, this is a good question. Please share your results for all of us when you receive more feedback.

I used and saw several methods for this important step in processing. The reality is that itโ€™s much easier to get the user to make a good picture than to detect or correct the image of the bed, which in many cases is not even possible. Therefore, discovery is pleasant to have, but this should not be the first action. There are so many options that can be activated before checking the image, and I have listed a few below.

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

  • Shake detection. Use the acceleration device to check for jitter during shooting. Good approach, but works mostly in bright light. In a dark environment, even with minimal shaking, the image can be easily smeared. This method should be used in combination with other methods.

  • Binarization on the device. It allows not only to compress and prepare the image for effective transmission, but also allows you to clearly see the quality of the text. Looking at a color image with a dark background, it is not as obvious about the sharpness of individual characters as a look at the black and white edges of these characters.

  • Preview screen. Let the user see the photo they took and are about to send. Often I see applications that allow you to view the image, but with the zoom turned off, when I double-click on it. Any text (even if it is bad) will look good on a tiny screen because you cannot see the text.

  • I call it forced preview. After you take the picture and, preferably, after binarization, automatically increase 10x and ask the user to confirm whether they see sharp text or not. It seems invasive, so good construction is important here, but this method is reliable because it can be taken as a necessary step.

  • Simple instructions on ... How to take good pictures! Some applications show once at first launch. Some applications give you the option to disable. In my applications, I saw a significant improvement in quality after providing these instructions after updating my FotoNote application on iOS.

+2
source

Source: https://habr.com/ru/post/946476/


All Articles