[Android] Return entire MRZ info for passport & upgrade tesseract4android to support 16kb page size for Android 15#4
Conversation
|
@batuhanoztrk let me know if you need any more details here. the android side seems a bit out of date and I'd rather help you fix this than publish my own forked package. |
|
Hi 👋 Thank you for your contribution and for focusing on improving passport (TD3) MRZ stability. I tested the PR locally with multiple passport samples. Unfortunately, I was not able to achieve consistently stable and accurate MRZ results with the current implementation. In some cases, the parsing behavior differs from the previous logic and produces unreliable outputs. Additionally, there are Android build issues introduced with this change, which prevent the project from compiling cleanly in its current state. For these reasons, I won’t be able to merge this PR as-is. I will review the approach and implement the necessary improvements directly in the library to ensure:
Thanks again for your effort and contribution 🙏 |
|
Totally understand and I appreciate your help too. It does seem like the OCR capability from tesseract is not as good as iOS vision APIs and there’s not a whole lot you can do to mitigate this. I use the mrz npm package to process the data afterwards and sometimes the checksum can correct itself but most of the time it doesn’t. From the online specimens I can find of random passports, I average about 50-60% accuracy. In my flow, I ask the user to validate the scan results and perhaps that’s a good use of the NFC verification as well. |
This change makes Android the same as iOS for MRZ value returned for passports. It should contain all the information scanned, not just the 4 values picked. It also returns the 2 lines combined together without a line break just like iOS.
I see the rest of the code also selectively returns part of the MRZ but I don't have any Turkish ID cards or other MRZ to test with.
As of Nov 2025, apps with the old 4kb page size cannot be submitted to Play Store anymore so the tesseract4android is a mandatory upgrade.