evermeer / PassportScanner

Scan the MRZ code of a passport and extract the firstname, lastname, passport number, nationality, date of birth, expiration date and personal numer.
BSD 3-Clause "New" or "Revised" License
457 stars 101 forks source link

I want to read MZR form USA passport how can I do it #37

Open nitinfullcycle opened 5 years ago

evermeer commented 5 years ago

MRZ is an international Standard. There is support for 2 and 3 lines MRZ. Is the US MRZ different? Do you know if there are any specs available?

evermeer commented 5 years ago

Maybe you could find a sample passport on the internet that i can use in a test?

nitinfullcycle commented 5 years ago

28b4cb0c09ce9f63c4ba053d2d97df20

This one

nitinfullcycle commented 5 years ago

Are you able to read MRZ of this picture, I tried with other USA passport it didn't work.

evermeer commented 5 years ago

When trying to scan that Image I see various output like this below. As you can see in 'Processing line 1' and 'Processing line 2' the OCR already fails. I think it's because of the relative dar background behind te tekst. I have tried finding other passports in google images, but the one I could found also had this problem. The US does use an MRZ format that should be supported. So it's entirely because of OCR scan results.

Processing line 1 : 4iP<USAAi<9y7ri7L<NACIM<<<<<<<<<<<<<<<<<<Z2ii7vifi1lyfgi
Processing line 2 : 7x9lK7907598779997999i29car2310303258572875<33A759EEQEEQ4
Document type : 4
Country code : P U
Last name : SAAi 9y7ri7L NACIM
First name : 
passportNumber : 7x9lK7907
nationality : 987
date of birth : nil
sex : 9
date of expiration : nil
personal number : 31030325857287
Check '7x9lK7907' for check '5'
--> PassportNumber is invalid
Check '799979' for check '9'
--> DateOfBirth is invalid
Check 'i29car' for check '2'
Check '31030325857287' for check '5'
--> PersonalNumber is invalid
Check '7x9lK790757999799i29car2310303258572875' for check '<'
--> Date is invalid
Scan quality insufficient : 0.5904899
nitinfullcycle commented 5 years ago

okay, I tried to scan same image using this scanner it worked Accura Scan. I am trying to find out how they are doing it. https://apps.apple.com/us/app/accura-scan-digital-kyc/id1220408071

evermeer commented 5 years ago

I think they created their own scanning software https://accurascan.com/accura-sdk mine is based on tesseract