Python disk catalog install#
If you need help configuring your development environment for OpenCV, I highly recommend that you read my pip install OpenCV guide - it will have you up and running in a matter of minutes. Luckily, OpenCV is pip-installable: $ pip install opencv-contrib-python To follow this guide, you need to have the OpenCV library installed on your system.
Python disk catalog how to#
In the rest of this tutorial, you will learn how to implement an automatic passport MRZ scanner with OpenCV and Tesseract. MRZs allow TSA agents to quickly scan your information, validate who you are, and enable you to pass through the queue more quickly, thereby reducing queue length (and reducing the stress on travelers and officials alike). It was a time-consuming task that was monotonous for the officials and frustrating for travelers who patiently waited for their turn in long immigration lines. The MRZ encodes your personal identifying information, including:īefore computers and MRZs, TSA agents and immigration officials had to review your passport and tediously validate your identity. These lines are called the MRZ of your passport. Type 1 passports have three lines, each with 30 characters, while Type 3 passports have two lines, each with 44 characters. Passport showing 3 lines of fixed-width characters at the bottom. If you look at the bottom of the passport, you’ll see 2-3 lines of fixed-width characters.įigure 1. Inside your passport, you’ll find your personal identifying information ( Figure 1). Once you arrive in your destination country, an immigration official checks your passport, validates your identity, and stamps your passport with your arrival date. You typically use your passport when traveling internationally. This document is issued by your country’s government and includes information that identifies you personally, including your name, address, etc.
What Is a Machine-Readable Zone?Ī passport is a travel document that looks like a small notebook. Once the MRZ is extracted, we can use Tesseract to OCR the MRZ.
From there, I’ll show you how to implement a Python script to detect and extract the MRZ from an input image. In the first part of this tutorial, we’ll briefly review what a passport MRZ is.
However, as we discovered in a previous tutorial, sometimes Tesseract needs a bit of help before we can actually OCR the text. So far in this course, we’ve relied on the Tesseract OCR engine to detect the text in an input image.
Python disk catalog code#
Looking for the source code to this post? Jump Right To The Downloads Section OCR Passports with OpenCV and Tesseract