> For the complete documentation index, see [llms.txt](https://docs.vida.id/vida-identity-platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vida.id/vida-identity-platform/product-overview/ocr-data-extraction.md).

# OCR Data Extraction

Optical Character Recognition (OCR) data extraction helps in simplifying the collection of user information for identity verification. Government-issued identity documents are collected from the user, typically via a photograph or scan, and the document contents are digitized using OCR technology. The resulting data is accurate and easily accessible, making it a valuable tool for organisations that are looking to verify the identity of individuals.

By digitising the information on ID documents, OCR data extraction reduces the risk of errors and improves the speed and efficiency of the verification process and also helps organisations to establish the foundation for secure and reliable digital signatures.

## **Key Aspects of OCR Data Extraction**

<figure><img src="https://1987382524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzqikP7fR7hLesltIaRUc%2Fuploads%2FF2hMBftrHWCpOoTk9T6z%2FUpdated%20flow.jpg?alt=media&amp;token=478992e8-79e4-4320-9ef7-1f555906ef42" alt=""><figcaption></figcaption></figure>

### Image Pre-processing

Before character recognition, the system performs image pre-processing to ensure the image meets the requirements for accurate text recognition. This involves checking the image size and resolution size to ensure the KTP object dimension is above 300 x 400 px and its file size is not larger than 2 MB.

{% hint style="info" %}
For detailed instructions on how to take a KTP or passport image for OCR, please refer to [the Image Guideline](/vida-identity-platform/integration-methods/api/document-ai/document-capture-guidelines.md).
{% endhint %}

### Character Recognition&#x20;

The OCR technology used in identity verification extracts data from government-issued ID documents with high accuracy and speed. This process significantly reduces the risk of errors and improves the efficiency of the verification process by translating text detection in an image into a machine-readable format.

### Template Matching

Template Matching is a crucial step in improving the accuracy of recognized text. The system applies template matching to specific fields, such as province (provinsi), city (kota/kabupaten), occupation (pekerjaan), gender (jenis kelamin), nationality (kewarganegaraan), and marital status (status perkawinan) fields to correct recognised text through normalization and template matching, which compares the recognised text with a database of expected values.

### Data Extraction and Output Format

&#x20;The OCR system extracts the required data from the document and organises it in a structured format such as a JSON file. The JSON field format provides a standardised output that can be used by other systems, making it a valuable tool for organisations looking to verify the identity of individuals in a reliable and secure manner.

To seamlessly integrate our OCR system into your workflow, please refer [OCR API Documentation](/vida-identity-platform/integration-methods/api/document-ai/ocr-v1-ktp-only.md).
