Below are the details about the expected external image quality and size for successful document image processing using our Document Reader SDK:
- the document should be completely inside the image, not touching the edges;
- the background should be contrast to the document (i.e. not white on white, or black on black, otherwise we cannot detect the document);
- preferably, the document should take 70-80% of the image area (this is important, as even if the image corresponds to 12 MP, but after detection and cropping the document is only 640x480 - it will not be processed correctly).
- JPEG compression should be not less than 70% of the original.
- tilt angle should be not higher than 10 degrees in any direction (horizontal or vertical), otherwise distortion will be too high to be corrected without damage to the image quality.
If you have, let’s say, an 800x600 image from a web camera and you have a document on the image, chances are high that document will take no more than 80% of the area. If this web camera is a standard one from the laptop, for example, then most probably it has fixed focus (no autofocus) and the document will not be in focus at this distance from the camera. In this case you couldn't expect high probability of successful OCR results.
If the document we are talking about is an ID card, then its size is 86x54 mm. Let’s do the math. 800 pixels * 0.8(80%) / 86 mm *25.4(mm per inch) = 189 PPI. This is really below the limits for correct OCR, as the font used, for example, in German ID cards is only 2 mm in height, so it will be 15 pixels only maximum, including JPEG compression artifacts and background noise, and all this will lead to poor OCR probability and mistakes.
To get successful results, this document image at minimum should be 300 PPI / 25.4 = ~12 pixels per mm (ppm) -> 86 mm * 12 ppm = 1032 pixels for document width -> 1032 / 0,8 (80%) = 1290 pixels for image width, where the document is flat on the surface without tilt to the camera.
If we talk about documents like passport, then calculations should be done accordingly to its larger size of 125x88 mm.
However, passports have MRZ with lower resolution constraints for successful OCR. If you present a passport occupying 80% of the 800x600 image, then its MRZ will be recognized with good probability in 90+% of cases if all other requirements on the image quality are met.
To conclude all that, images from a Full HD resolution (1920x1080) camera with autofocus are recommended to get proven good quality OCR results for any identity document size.