Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to scan the MRZ of an ID card #5

Closed
evermeer opened this issue Aug 27, 2016 · 17 comments
Closed

Add support to scan the MRZ of an ID card #5

evermeer opened this issue Aug 27, 2016 · 17 comments

Comments

@evermeer
Copy link
Owner

As reported by @jrodriguezq there is no support for the MRZ for an ID card. I will add this as an enhanecment later.

Original question:

The last commit fixes the issue that I had with the camera, now it looks like this:
img_3139

The OCR it's working, but I'm not able to correctly read the MRZ. As you can see, the image appears to be clear enough.
The usual case of the mrz captured it's something like this:

INCHL1D41230409D26<<<<<<<<<<<<
9002063M2002064CHL17409866<2<6
CORTES<CONTRERAS<<SERGIO<JAV ll 12

This appears to be almost correct, but some numbers and blank characters usually stand in the way and I'm not able to scan the MRZ.
Is there any configuration that I'm missing?

Again, many thanks for the library.

@sahar12345
Copy link

Hi can I talk to u about the programe

@evermeer
Copy link
Owner Author

evermeer commented May 5, 2017

@sahar12345 sure

@sahar12345
Copy link

I want to make programe in phone app like netbeans and xamrine must make iOS and android separate and I want connect to server can u the programe read I don't understand good to the folder code u put and how communicate with server that make confused

@sahar12345
Copy link

Netbeans in java programe

@sahar12345
Copy link

If that reading for national I'd card like Japan or negirea national card like this programe of passport

@sahar12345
Copy link

And so thank you so much

@evermeer
Copy link
Owner Author

evermeer commented May 6, 2017

Passport scanner is a complete native iOS only solution. There is no support for Android. There is no server required. The OCR is done on the phone itself.

If you want to make an iOS app that sends the result of a scan to your own server, then you have to create your own logic for that. In the demo app you will have the file ViewController.swift which calls the PassportScanner interface. There in the function processMRZ you can add logic for handling the MRZ information.

@sahar12345
Copy link

Thank you but in my opinion that netbeans can make programe to all kinds iOS and android and its supported,that idea of logic server I will make today and show you and am glad if reply on results that from ur kind,thnx to u.

@punto2018
Copy link
Contributor

Any news for this topic?
Currently I'm working with 3 lines passports so I'm starting to develop the validator.
I can't find technical infos (checksum, char position semantic, etc) in order to integrate the support.

@evermeer
Copy link
Owner Author

@punto2018
For the password MRZ I was able to create the logic based on what was described on wikipedia. See https://en.wikipedia.org/wiki/Machine-readable_passport as you can see there is also a description for official travel documents with 3 lines. That should be enough information.

@punto2018
Copy link
Contributor

Thanks for your reply. I'm using the official specifications document for a better parsing (https://www.icao.int/publications/Documents/9303_p5_cons_en.pdf).
I'm able to acquire and parse a 3 lines MRZ, but I'm experimenting some issues with the camera.
I don't want mix topics here, I will open a new issue.

Thanks

@punto2018
Copy link
Contributor

Good news, resolving the camera issues it seem that the parsing is working fine. If you agree I can share my changes and generate a pull request. The idea is to add a property in order to easily switch MRZ parsing type (2 lines or 3 lines), using the 2 lines as default for retrocompatibility reasons.

@evermeer
Copy link
Owner Author

A PR for that is definitely welcome!
Maybe it's possible to autodetect it it's a MRZ 2 or 3? If you have an OCR result where 3 lines have more than 30 characters, then it's probably a MRZ 3?

@punto2018
Copy link
Contributor

This approach can be used, my only concern is in the performance in trying both parsers.
It is not possible make simple assumptions in the number of lines.
Italian ID Card for example have a barcode on top of MRZ and often the user also frame it, resulting in a 4 lines OCR result, where the first line is something like "I 1 III 1 || \ 1 .....".
In this case filtering the first line is an important improvement in MRZ scan.
Anyway, I suggest a 3 value parsing type: auto, 2 lines, 3 lines, where auto can use a sort of "smart" choice in order to select the first parser to try.

What do you think?

@evermeer
Copy link
Owner Author

Sounds good

@Mattijah
Copy link

Mattijah commented Oct 16, 2018

@evermeer, @punto2018, @sahar12345. Here is a MRZ parser with support of all official documents. On top of that it does some OCR cleaning too. All you need to do is just set it up as a pod. Enjoy

https://github.com/Mattijah/QKMRZParser

@evermeer
Copy link
Owner Author

The PR has been merged, pushed and published. There is now support for 3 line MRZ. Thanks @punto2018 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants