Blog

Why passport OCR fails outside the machine readable zone

· 4 min read

Passport text recognition is far more dependable on the machine readable zone (MRZ) than on the printed zone. The MRZ has fixed positions, a small character set and check digits that catch many misreadings. The printed fields, such as place of birth and date of issue, have no fixed position, follow no single label layout, and sit among security printing and photographs that confuse recognition software. That is why every printed field needs a person to look at it before it is saved.

Why the MRZ is the reliable part

ICAO Doc 9303 fixes where each MRZ field starts. On a TD3 passport the name, the document number and the dates always sit in the same character positions on the two lines, as set out in Doc 9303 Part 4.

The character set is also small. In the MRZ only the capital letters A to Z, the digits 0 to 9 and the filler character < may be used. Punctuation is not allowed, so an apostrophe or hyphen in a name has to be handled by the rules in Doc 9303 Part 3, which the name article explains in passport names with accents in the MRZ.

The check digits are the third safeguard. ICAO calculates them with weights of 7, 3 and 1 repeating, and gives the letters A to Z the values 10 to 35. The full method is in Doc 9303 Part 3, and the arithmetic is worked through in MRZ check digit calculation.

The printed zone has no fixed layout

ICAO leaves the printed zone, which it calls the visual inspection zone, to each issuing state. Its specification says optional data elements exist so issuing states can meet their own requirements. The result is that the same field can sit in a different place from one country to the next. Flexible layouts in ICAO's own examples show a signature overlapping the portrait, or a zone stretched to overlap another.

Printed text can also differ in form. Diacritics are allowed in the printed zone, and a name written in a non-Latin script must be given with a transcription. A page can therefore show a name with accents, a transcription, and a version in a second language, while the MRZ carries only one simplified form.

Security printing, holograms and laminate patterns can sit over the text the software is trying to read. A stamp or visa label can cover part of the page. ICAO's visa specification says an official stamp must not intrude into the MRZ.

Look-alike characters, and what check digits catch

The letter O and the digit 0 look alike in many fonts. In the MRZ they have different values: O is 24 in the check digit arithmetic, and 0 is 0. Take the document number L898902C3 from the fictional specimen used across this blog. Its check digit is 6. If the sixth character, a 0, is read as O, the check digit recalculates to 0, and the mismatch shows the error.

The same happens with I and 1. In the specimen date of birth, 740812, the 1 has a check digit of 2. Read it as I, which has the value 18, and the check digit comes out as 3.

Check digits only protect the MRZ. The printed date of birth, 12 AUG 1974, has no check digit. If the printed 8 is misread as a 3, nothing in the printed zone reveals it. Compare the printed fields with the MRZ, and treat any printed field that has no MRZ twin as unchecked.

Check digits also do not catch everything. A misread letter in a name is still a valid letter, so no check digit flags it. Two errors can also cancel out in the arithmetic. A passing check digit means the MRZ is probably read correctly, not that the whole page is correct.

Long names and truncation

When a name is too long for the 39 positions available, the MRZ shortens it. ICAO's rule removes characters from the primary identifier and requires the final character of the name field to be alphabetic, which signals that truncation has happened. A reader that ignores that signal may present a clipped name as the full one.

Why a review step matters

A reader can correctly recognise every character and still fill in the wrong field. It can split a name at the wrong filler, merge two given names, or assign the place of birth to the issue date. A review screen lets a person see the source, compare it with the page, and fix the field. It adds a little time to each passport, and it stops a wrong name from reaching a crew list.

Look at the printed page in your hand. Check the name, the date of birth, the expiry date and the document number against the MRZ, then check the place of birth and issue date against the printed page, because those two have no MRZ check at all. For how the date formats differ, see passport date formats.

Where ScanPass fits

ScanPass reads the MRZ, verifies its check digits, and also looks for place of birth and issue date in the printed part of the page. It shows the result for review, and the user can correct every field before saving. Recognition runs on the phone, and the app is still in development, coming soon to the App Store. It is not downloadable yet. The review step is there because no reader, including this one, should be trusted without a look.