konstantint / PassportEye

Extraction of machine-readable zone information from passports, visas and id-cards via OCR
MIT License
374 stars 109 forks source link

0_id-esp.png not working #37

Closed Lechucico closed 4 years ago

Lechucico commented 5 years ago

I'm trying to read Spanish MRZ ID card, but it's not working.

The photo is the one provided in this repository:

0_id-esp

This is what I obtain from the following command: mrz 0_id-esp.png --json

{
  "mrz_type": null,
  "valid": false,
  "valid_score": 0,
  "walltime": 0.031235933303833008,
  "filename": "0_id-esp.png"
}

EDIT I've tested with my own Spanish ID card as a photo and his detection is completely random. Some photos simply show mrz_type: null, another ones show valid_score: 5 with all data wrong and some more valid_score: 50 with almost all data correct. It's almost the same photo (taken all with an iPhone X).

konstantint commented 5 years ago

Note that the names of the files in the repository start with the number, indicating the "valid_score" that the algorithm was achieving at least at some point. The fact that the file is named 0_xxx indicates that, indeed, the method fails to extract the correct data here and I did not find enough time to debug the individual steps to tune the image extraction for this image in particular.

As for photos, do note that three common problems with them, which may confuse PassportEye are:

In order to understand the actual reasons for the failure one should try examining the individual steps of the processing pipeline and tuning them appropriately. I might find some time to deal with it myself, but most probably not within a couple of months at least.