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

Detecting "0" as "O" #12

Open
brqgoo-zz opened this issue Jul 13, 2020 · 7 comments
Open

Detecting "0" as "O" #12

brqgoo-zz opened this issue Jul 13, 2020 · 7 comments

Comments

@brqgoo-zz
Copy link

Hi all, I've have implemented the library which works well on passports. However it detects "0" as "O" in some parts of ID card (TD1) MRZ zone.

For instance, it's perceiving serial number as "AO0G028686" which is actually: "A00G028686"

IMAGE 2020-07-13 15:17:14

@Mattijah
Copy link
Owner

Hi @brqgoo, thanks for reporting the issue. I will have a look whether we can improve this in some way. The problem here is that these passports & IDs don't always use the exactly same font style and so the recognition of 0 and O may sometimes fail.

@bugrym
Copy link

bugrym commented Nov 19, 2020

Hello @Mattijah. I faced with the same problem while scanning ID card. Is it possible to improve this? I was trying to solve this by my own, but haven't found anything yet. Best regards.

@Mattijah
Copy link
Owner

Mattijah commented Nov 19, 2020

Hi @bugrym, it is certainly possible to improve this and I will try, I'm just currently way too busy working on some other stuff 😕 Hopefully, I'll find some time soon. In regards to some data that should (do) consist of numbers only you can fix this for now easily by yourself. Just check whether the string contains letters and if so replace them with numbers. This is handled to a certain extend by the parser too https://github.com/Mattijah/QKMRZParser/blob/master/QKMRZParser/MRZFieldFormatter.swift#L39-L52. I do understand that this is not an ideal fix and I'll have to improve the actual recognition, but at least a little help.

https://github.com/Mattijah/QKMRZParser/blob/master/QKMRZParser/MRZFieldFormatter.swift#L119-L128

@bugrym
Copy link

bugrym commented Nov 19, 2020

@Mattijah I got it. Thanks a lot. I'll looking forward for any updates from yours.

@emirbeytekin
Copy link

the problem continues..

@tolgasayan2
Copy link

@emirbeytekin
at MRZFieldFormatter file;
create a String extension in order to take elements by one by from an array to replace and to correct func; add case .documentNumber:

      return string[0] + string[1].replace("O", with: "0") + string[2] + string[3].replace("0", with: "O") + string[4] + string[5] + string[6] + string[7] + string[8]

@Mattijah
Copy link
Owner

@emirbeytekin it continues because it hasn't been resolved.

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

5 participants