Skip to content

[Android] Return entire MRZ info for passport & upgrade tesseract4android to support 16kb page size for Android 15#4

Closed
danielduan wants to merge 3 commits into
batuhanoztrk:mainfrom
danielduan:patch-1
Closed

[Android] Return entire MRZ info for passport & upgrade tesseract4android to support 16kb page size for Android 15#4
danielduan wants to merge 3 commits into
batuhanoztrk:mainfrom
danielduan:patch-1

Conversation

@danielduan
Copy link
Copy Markdown

@danielduan danielduan commented Feb 23, 2026

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.

@danielduan danielduan marked this pull request as ready for review February 23, 2026 20:15
@danielduan danielduan changed the title [Android] Return entire MRZ info for passport instead of the select 4 parameters [Android] Return entire MRZ info for passport & upgrade tesseract4android to support 16kb page size for Android 15 Feb 24, 2026
@danielduan
Copy link
Copy Markdown
Author

@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.

@batuhanoztrk
Copy link
Copy Markdown
Owner

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:

  • Stable and consistent TD3 (passport) MRZ extraction
  • No regression compared to the existing implementation
  • Clean Android build without dependency or compatibility issues

Thanks again for your effort and contribution 🙏

@danielduan
Copy link
Copy Markdown
Author

danielduan commented Feb 24, 2026

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.

@batuhanoztrk batuhanoztrk linked an issue Feb 24, 2026 that may be closed by this pull request
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

Successfully merging this pull request may close these issues.

Reader not working

2 participants