-2

I am working on an app where user needs to click an image of a document and upload and server will do the further processing of doing OCR and extracting specific data from it. OCR and data extraction completely depends on the image quality. So what is the best way, i can instruct user to take a near to perfect image of document at run-time.

Factors i am considering.

1) Light available while capturing image (Can't use the light sensor because it is present on front side of phone whereas document will be on bottom side)

2) Document angle. (Tried edge detection using openCV but not properly works on white document with light color background surface. Any Edge detection tutorial for run-time document detection over custom camera surface will also be a great help)

3) Distance from document.

Processing the image after capturing (Transforming the document to a rectangle using openCV) is not always giving a great result with OCR because of character distortion.

So please suggest some way to instruct the user to take a better image of straight document from a perfect distance and better lightening conditions. And also after capturing best way to judge the image quality.

Nitesh
  • 3,550
  • 1
  • 17
  • 24
  • 3
    Hm. What's wrong with regular dialog or text message? – Marcin Orlowski Aug 21 '17 at 07:37
  • User can easily ignore those. I want to instruct user on particular event like when the light is dim or when the document is not placed correctly or he is capturing image from a large distance. – Nitesh Aug 21 '17 at 07:40
  • 2
    Then it's his problem. or if you believe you detected low quality image, simply do not process it further. – Marcin Orlowski Aug 21 '17 at 07:49
  • yes, but that is the business need here. Because this feature is already live and working. And big size of users who are uploading, not clicking very good images. So i need to force the user to click a better image. – Nitesh Aug 21 '17 at 07:54
  • 3
    IMHO: process preview image (or even its tumb) on-the-fly with lightweight quality estimation algorithms and inform user about low quality and its reason (e.g. low brightness) and, may be, block "take snapshot" control. – Andrii Omelchenko Aug 21 '17 at 08:52

2 Answers2

1

If proportions of document is known, you can draw appropriate inner (for min document size) and outer (for max document size) bounding rectangles on preview (as shown on pict) enter image description here and control that user positioned document within outer and over inner bounding rect. That is also helps to control right document angle. Also You can control tilt and orientation of smartphone as described in answers for this questions.

Then process preview image (or even its small copy) on-the-fly with lightweight quality estimation algorithms and inform user about low quality and its reason (e.g. low brightness, you can estimate brightness of outer rectangle region, for example, as described in this question) and, may be, block "take snapshot" control.

Andrii Omelchenko
  • 12,030
  • 12
  • 40
  • 70
0

You can use classifier (Machine Learning techniques) to reject low quality images using various features which can differentiate between low and good quality or images captured from long distance by detecting the document in the image.

Jazz
  • 838
  • 1
  • 7
  • 20