6.3.1 Passport Extraction

This topic provides the information about the Passport Extraction.

Passport Extraction module extracts details in the passport like Country, Document Type, Name, First Name, Last Name, Gender, Date of Birth, Date of Issue and Date of expiry of the passport, Passport No and Issuing Authority if present in the passport along with Image metadata information like Image DPI, Resolution and Image Size. This module provides support for passports of various countries listed below:
  • USA passport and passport-card
  • UAE
  • INDIA
  • CANADA
  • AUSTRALIA
  • BANGLADESH

All the details in the passport/ passport-card (Incase of USA) are extracted using "/extractInformation" API.

Brief of Working:

It takes "country", "document type" and "Base64 encoded image" of the passport as input. It internally generates processed text from the passport and extracts details like Name, First Name, Last Name, Gender, DOB, DOI and DOE, PP No. and Issuing Authority if present in the document. Along with the document details, it also gives image metadata information like Image DPI, Resolution and Size, etc. The output is represented in JSON format.

Table 6-1 Passport Extraction API Format

Sl.No Description Comments
1 Format of input images it supports jpg, jpeg, png, pdf
2 Output Format JSON
3 Simple multiple input files Yes

Input Request:

"/extractInformation" API -

For a single image: Base64 encoded image, Country, Document Type ("passport" in this case).

For multiple images: Array of the Base64 encoded images, Country, Document Type ("passport" in this case).

Sample Input Request:
{
"country": "UAE",
"docType": "passport",
"docBase64s": [
"------base64 encoded image string------"
]
}

Note:

In case of USA, there are 2 types of document: passport and passport-card. If the input document is of type passport-card, the docType should be mentioned as passport-card.

Output Response:

The output of "/extractInformation" API is the extracted details in the JSON format given below:

Sample Output Response:
{
"documentDetails": [
{
"ImageInfo": {
"file_size": "647.22 KB",
"image_dpi": "150",
"image_resolution": "704x541",
"information": "Minimum 300 DPI is required. File size is proper."
},
"dateOfBirth": "7/11/2001",
"dateOfExpiry": "11/6/2022",
"dateOfIssue": "12/6/2017",
"docType": "Passport",
"firstName": "SHAMA",
"gender": "F",
"identificationNumber": "F0Z615883",
"issuedCountry": "UNITED ARAB EMIRATES",
"issuingAuthority": "",
"lastName": "RASHED ABDULIALIL MOHAMED ALFAHIM",
"name": "SHAMA RASHED ABDULIALIL MOHAMED ALFAHIM"
}
]
}

Note:

Even if Country and DocType not provided in the input request, the service tries to extract the Country Name and Document Type automatically. In case, if it is not able to extract it returns an exception/ error. This means either the quality of the document is not enough to extract all the details or resolution is poor.
Recommendations for Better Performance:
  • The better the quality of the source image, the higher the accuracy of extraction will be.
  • Keeping DPI lower than 200 will give unclear and incomprehensible results while keeping the DPI above 600 will unnecessarily increase the size of the output file without improving the quality of the file. Thus, a DPI of 300 works best for this purpose.
But what means “image quality” in this case?
  • Min text-size 10 pts (below 8pts are removed by noise)
  • Min resolution (dpi) of 300 works best for Text Extraction.
  • Sharp and visible characters
  • Min image size of 200 kb
  • Less image or background noise

Documents Supported:

It supports passports of the following countries:
  • USA Passport and Passport-card both
  • UAE
  • INDIA
  • CANADA
  • AUSTRALIA
  • BANGLADESH
Things to be taken care of:
  • Make sure the base64 encoded image string of the input image is correct.
  • Document Type provided in the input should be "passport" only
  • Specify the country name correctly for accurate extraction of details