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

When scanning a real passport, it has a hard time to scan the MRZ #41

Open
LaurentDaudelin opened this issue Dec 21, 2020 · 1 comment

Comments

@LaurentDaudelin
Copy link

Not sure why. I have both a Canadian and US passport. The Canadian did scan on the first try. I got one shot at the US but subsequent attempts failed. I just get this warning in the console:

Scan quality insufficient : 0.0
2020-12-21 12:03:57.630215-0500 PassportScanner[1519:784903] [Unknown process name] CGImageCreate: invalid image alphaInfo: kCGImageAlphaNone. It should be kCGImageAlphaNoneSkipLast
- Start recognize
Scan result : bylaw 1w xf I  L

I have ideal light, the code appears clearly on the iPhone 11 that I'm using.

@evermeer
Copy link
Owner

evermeer commented Jan 4, 2021

As you can see the Scan result shows some gibberish.
For the scan I am using the tesseract library
I have seen before that certain passports have bad scan results.
I added some filters, but probably the standard does not work well with US passports
You could try playing around with the parameters that are trying to improve the scan result
You can find these in the lines below line 144 in
https://github.com/evermeer/PassportScanner/blob/master/Pod/PassportScannerController.swift
If you are able to set better parameters, then I would really like to hear what those are.

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

No branches or pull requests

2 participants