6.3.3 National Identification Extraction

This topic provides elaborates the payload details for National ID Card Details extraction service.

National ID card Details Extraction module extracts details in the National Identity Card like Name, First Name, Last Name, Gender, Address (if present), Date of Birth, Date of Issue and Date of expiry of the NID, ID No , etc along with the image metadata information like Image DPI, Resolution and Size. This module provides support for NID's of various countries listed below:
  • USA
  • South Africa
  • Brazil
  • Bangladesh
  • India
  • Kenya
  • Portugal

All the details in the ID are extracted using "/extractInformation" API.

Brief of Working:

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

Input Request:

"/extractInformation" API -
  • For a single image: Base64 encoded image, Country, Document Type (“nid" in this case).
  • For multiple images: Array of the Base64 encoded images, Country, Document Type ("nid" in this case).
Sample Input Request:
{
"country": "BR",
"docType": "nid",
"docBase64s": [
"------base64 encoded image------"
]
}

Output Response:

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

Sample Output Response:
{
"documentDetails": [
{
"ImageInfo": {
"file_size": "566.32 KB",
"image_dpi": "72",
"image_resolution": "680x453",
"information": "Minimum 300 DPI is required. Poor Image Resolution. File size is proper."
},
"dateOfBirth": "12/7/1960",
"dateOfExpiry": "20/8/2030",
"dateOfIssue": "",
"docType": "NID",
"firstName": "FERNANDA",
"gender": "F",
"identificationNumber": "000000005-9",
"issuedCountry": "BRAZIL",
"issuingAuthority": "",
"lastName": "DE CARVALHO DA SILVA",
"name": "FERNANDA DE CARVALHO DA SILVA"
}
]
}

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.
  • 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 Support:

It supports Licenses of the following countries:
  • USA
  • South Africa
  • Brazil
  • Bangladesh
  • India
  • Kenya
  • Portugal
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 "nid" only
  • Specify the country name correctly for accurate extraction of details