Open brqgoo-zz opened 4 years ago
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.
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.
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
@Mattijah I got it. Thanks a lot. I'll looking forward for any updates from yours.
the problem continues..
@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]
@emirbeytekin it continues because it hasn't been resolved.
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"