Test in a live environment
Test in production without watermarks.
Works wherever you need it to.
A passport is an individual's identity; we use passports to travel and register essential aspects of our lives. However, the passport format is not always easy to read. Imagine many travelers suddenly appearing during the holiday season for travel and leisure. How can the immigration agents handle that large amount of value with manual data entry and retrieve the correct information manually?
Hence, many applications and enterprises are turning to optical character recognition (OCR), which allows developers to quickly extract printed or handwritten text and digital images.
Similarly, Passport OCR is a technology that uses optical character recognition (OCR) software to extract meaningful information from passports; it also utilizes the machine-readable zone for all passports to retrieve information to identify the individual trying to pass through the imagination quickly. In scenarios where you need to recognize passport information quickly or in a process involving automating passport data extraction, Passport OCR is vital and is the cornerstone of efficiency and speed in airports and immigration borders.
Although Passport OCR software and technology have developed further and further over the years, there are a lot of factors when it comes to scanning the document. Digital images with noise or smugs on the passport can heavily affect the accuracy of the passport. Furthermore, OCR libraries can sometimes be confusing when operating on a passport, as the machine-readable zone is a unique structured data set. Developers might be able to extract data but have to sort the parameters independently. However, with IronOCR, specialized methods are optimized for reading passports; its results allow developers to obtain and manipulate the information quickly, which is ideal for high-volume scanning and automation.
In this article, we'll briefly discuss using IronOCR to obtain and manipulate passport information to automate data extraction and provide further details on how IronOCR interacts with the passport.
IronOCR is a C# Library that offers easy-to-use methods and flexible functionality for all OCR-related needs. In addition to the standard techniques, IronOCR allows developers to fully utilize and customize a customized version of Tesseract to achieve all related tasks.
Here's a quick rundown of its most notable features below:
Cross compatibility: IronOCR is compatible with most .NET platforms, including .NET 8,7,6 and 5, and supports .NET Framework 4.6.2 upwards. With this library, developers don't have to worry about cross-compatibility, as it also supports all operating system forms. Ranging from Windows, macOS to Azure and even Linux:
Flexibility: OCR input comes in many formats, so a library has to handle all sorts of formats to be truly flexible. IronOCR accepts all popular image formats (jpg, png, and gif) while supporting the native "System.Drawings.Objects" from C#, allowing easier integration to existing codebases.
Support and ease of use: IronOCR is well documented, with extensive API and tutorials indicating all forms of functionality. Furthermore, there is 24/5 support, ensuring the developers are always supported.
Please remember that IronOCR requires a licensing key for operation. You can get a key as part of a free trial by visiting this link.
//Replace the license key variable with the trial key you obtained
IronOCr.License.LicenseKey = "REPLACE-WITH-YOUR-KEY";
//Replace the license key variable with the trial key you obtained
IronOCr.License.LicenseKey = "REPLACE-WITH-YOUR-KEY";
'Replace the license key variable with the trial key you obtained
IronOCr.License.LicenseKey = "REPLACE-WITH-YOUR-KEY"
After receiving a trial key, set this variable in your project.
The code below showcases how IronOCR takes a passport image and extracts all relevant information using the library's passport OCR SDK.
using IronOcr;
using System;
// Instantiate OCR engine
var ocr = new IronTesseract();
using var inputPassport = new OcrInput();
inputPassport.LoadImage("Passport.jpg");
// Perform OCR
OcrPassportResult result = ocr.ReadPassport(inputPassport);
// Output passport information
Console.WriteLine(result.PassportInfo.GivenNames);
Console.WriteLine(result.PassportInfo.Country);
Console.WriteLine(result.PassportInfo.PassportNumber);
Console.WriteLine(result.PassportInfo.Surname);
Console.WriteLine(result.PassportInfo.DateOfBirth);
Console.WriteLine(result.PassportInfo.DateOfExpiry);
using IronOcr;
using System;
// Instantiate OCR engine
var ocr = new IronTesseract();
using var inputPassport = new OcrInput();
inputPassport.LoadImage("Passport.jpg");
// Perform OCR
OcrPassportResult result = ocr.ReadPassport(inputPassport);
// Output passport information
Console.WriteLine(result.PassportInfo.GivenNames);
Console.WriteLine(result.PassportInfo.Country);
Console.WriteLine(result.PassportInfo.PassportNumber);
Console.WriteLine(result.PassportInfo.Surname);
Console.WriteLine(result.PassportInfo.DateOfBirth);
Console.WriteLine(result.PassportInfo.DateOfExpiry);
Imports IronOcr
Imports System
' Instantiate OCR engine
Private ocr = New IronTesseract()
Private inputPassport = New OcrInput()
inputPassport.LoadImage("Passport.jpg")
' Perform OCR
Dim result As OcrPassportResult = ocr.ReadPassport(inputPassport)
' Output passport information
Console.WriteLine(result.PassportInfo.GivenNames)
Console.WriteLine(result.PassportInfo.Country)
Console.WriteLine(result.PassportInfo.PassportNumber)
Console.WriteLine(result.PassportInfo.Surname)
Console.WriteLine(result.PassportInfo.DateOfBirth)
Console.WriteLine(result.PassportInfo.DateOfExpiry)
IronOCR can extract the Machine Readable Zone (MRZ) information from the bottom two rows of any passport following the International Civil Aviation Organization (ICAO) standard. The MRZ data comprises two rows, each containing unique information. For detailed information on what each position in the rows corresponds to and for any exceptions and unique identifiers, please consult the ICAO documentation standards.
Here's a brief table on it:
Image quality is always a problem when scanning digital images. A distorted image quality would obscure the information and make it harder to confirm the accuracy of the data. Furthermore, developers must consider data security and compliance when dealing with mission-critical information such as a passport.
IronOCR also provides a way to briefly debug and showcase the concept for the interaction information ion. These methods allow developers to troubleshoot and be confident in the extracted data.
Here's a brief example of it:
using IronOcr;
using System;
// Instantiate OCR engine
var ocr = new IronTesseract();
using var inputPassport = new OcrInput();
inputPassport.LoadImage("Passport.jpg");
// Perform OCR
OcrPassportResult result = ocr.ReadPassport(inputPassport);
// Output Confidence level and raw extracted text
Console.WriteLine(result.Confidence);
Console.WriteLine(result.Text);
using IronOcr;
using System;
// Instantiate OCR engine
var ocr = new IronTesseract();
using var inputPassport = new OcrInput();
inputPassport.LoadImage("Passport.jpg");
// Perform OCR
OcrPassportResult result = ocr.ReadPassport(inputPassport);
// Output Confidence level and raw extracted text
Console.WriteLine(result.Confidence);
Console.WriteLine(result.Text);
Imports IronOcr
Imports System
' Instantiate OCR engine
Private ocr = New IronTesseract()
Private inputPassport = New OcrInput()
inputPassport.LoadImage("Passport.jpg")
' Perform OCR
Dim result As OcrPassportResult = ocr.ReadPassport(inputPassport)
' Output Confidence level and raw extracted text
Console.WriteLine(result.Confidence)
Console.WriteLine(result.Text)
Similarly, the code in the example above remains the same; however, the console output differs as we directly access the `Text` and `Confidence` properties instead of the individual members of the passport.
Passport OCR technology significantly enhances document processing by automating data extraction and improving operational efficiency. It streamlines identity verification and KYC processes, ensuring high accuracy while handling sensitive personal information. Immigration borders and airports can reduce processing time and improve workflow efficiency by choosing IronOCR as their Passport OCR API.
IronOCR provides developers with flexibility and scalability through its easy-to-use methods. It allows developers to sort information quickly through the `OcrPassportResult` object. Furthermore, IronOCR provides debugging tools, including confidence levels and raw, unparsed text, for developers to use in product unit tests. IronOCR also minimizes the digital noise manually for more advanced usage by clearing out the passport image input before passing it through the method.
Feel free to take advantage of IronOCR's free trial license page.
9 .NET API products for your office documents