Best JSON configΒΆ

Here is the best config we recommend:
  • YUV420P image format as input: This format is easy to convert to grayscale (format expected by the recognizer and detector). You should prefer YUV420P instead of YUV420SP (NV12 or NV21) as the later is semi-planar which means the UV plane is interleaved. De-interleaving the UV plane take some extra time.

  • 720p image size: Higher the image size is better the quality will be for the detection and recognition parts. 720p is a good trade-off between quality and resource consumption. Higher image sizes will give your camera a hard time which means more CPU and memory usage.

  • 2 for minimum number of lines: All standard MRZ formats requires at least 2 lines. Requiring a minimum of 2 lines improves the precision score (more orphans will be removed) and speedup the processing (no recognition on orphans). JSON config: "min_num_lines": 2

  • 0% for minimum score: We recommend using a 0% threshold to make sure no recognition result will be rejected. Use data validation to decide whether to keep or reject a result. Another sanity check in addition to data validation is to make sure all MRZ lines have the same number of characters. JSON config: "min_score": 0.0

The configuration should look like this:
{
    "debug_level": "warn",
    "min_score": 0.0,
    "min_num_lines": 2
}