These are the expected details about the quality and size of the images required to successfully capture an identity document:
- The document must be completely inside the image, without touching the edges.
- The background must contrast with the document (i.e. not white on white or black on black, otherwise the edges may not be detected correctly).
- The document should preferably occupy 70-80% of the area of the image. This is important because the verification may not be processed correctly if after detection and trimming the document size is less than 640x480pixels, even when the image is heavy (>8MP).
- JPEG compression ratio should not be less than 70% of the original.
- The angle of inclination should not be more than 10 degrees in any direction (horizontal or vertical) so that the correction of the distortion does not damage significantly the quality of the image.
If we have, for example, a 800 × 600 image from a webcam and we detect a document in it, it is very likely that the document does not occupy more than 80% of the area. If this webcam is a portable standard, it is most likely that it has a fixed (non-automatic) focus and that the document is not focused at this distance from the camera. In this case, keep in mind that if for a human eye is difficult to read it, the reliability of the OCR won’t be perfect.
If the document we are talking about is an identity card (TD1), its size is 86 × 54 mm. Let’s do the calculations: 800 pixels * 0.8 (80%) / 86 mm * 25.4 (mm per inch) = 189 PPI. Which would be below the limits of any OCR, since the font used, for example, in the German ID cards (TD2) is only 2 mm high, which would translate into 15 pixels, in which we should also consider JPEG compression loss and background noise.
To obtain the expected results, this image must be at least 300 PPI / 25.4 = ~ 12 pixels per mm (ppm) -> 86 mm * 12 ppm = 1032 pixels for the width of the document -> 1032 / 0.8 (80 %) = 1290 pixels for the width of the image, assuming that the document is perpendicular to the camera.
In the case of a passport (MRP) or visa (MRV) of 125 × 88 mm, we will consider 125 mm * 12pmm = 1500 pixels for the width of the document -> 1500 / 0.8 (80%) = 1875 pixels for the width from image.
However, MRTDs (Machine Readable Travel Documents) have MRZs (Machine Readable Zone) with lower resolution restrictions than those described if it is not necessary to compare data with the visual zone (VIZ) to check the integrity. In this case, an image of 800 × 600, will be recognized without failures in 90% of cases if all other requirements of image quality are met.
To summarize, it is recommended to obtain the images with a Full HD resolution camera (1920 × 1080) with autofocus for any size of identity document. Do not forget: