> For the complete documentation index, see [llms.txt](https://docs.vida.id/identity-stack/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/identity-stack/verify/kyc-mobile-sdk/sdk-user-journey/document-capture/document-capture-guidelines.md).

# Document Capture Guidelines

### Image Specification

Prior to performing document checks or character recognition, the VIDA Document Verification or OCR system undergoes image pre-processing to ensure optimal text recognition accuracy and document verification. This includes evaluating the image size and resolution to meet specific requirements. The system checks that the Card object within the image has dimensions greater than or equal to 400 x 300 pixels (width x height). Additionally, the file size of the image should not exceed 2 MB.

<table><thead><tr><th width="313.127685546875">Image Setting</th><th>Requirements</th></tr></thead><tbody><tr><td>Minimum camera pixel</td><td>Above 2 MP</td></tr><tr><td>Image file size</td><td>Minimum size: 100 KB<br>Maximum size: 2 MB</td></tr><tr><td>Image compression recommendation</td><td>Bicubic, with minimum JPEG quality 80%</td></tr><tr><td>Image Dimension</td><td>Minimum Dimension: 300 x 400 px<br>Maximum Dimension: 4000 x 3000 px</td></tr><tr><td>Coverage</td><td>The ID document image should occupy at least 80% of the entire image.</td></tr><tr><td>Supported Image Formats</td><td>JPG/JPEG/PNG</td></tr></tbody></table>

{% hint style="info" %}
To ensure accurate Document Verification and OCR extraction from ID document images, please refer to the guidelines provided in the below Key Image Quality Recommendations section.
{% endhint %}

### Key Image Quality Recommendations for Document Capture

### Horizontal Orientation&#x20;

OCR data extraction and the Document Verification is specifically designed to recognize text that is horizontally oriented on the ID Document. To ensure accurate extraction of data, it is important that the document image is horizontally aligned and not rotated.&#x20;

**Ideal KTP Image**

<figure><img src="/files/KW7gRdKJXs2hqDEWKsLz" alt="" width="375"><figcaption></figcaption></figure>

### Device Orientation

In the VIDA OCR system, OCR data extraction is optimized to recognize text on the ID Document. To ensure accurate extraction of data, it is crucial that the document image is horizontally aligned, while the device camera orientation should be portrait.

<figure><img src="/files/3pdxPQQqaTvrBi05sv8z" alt="" width="563"><figcaption></figcaption></figure>

### Proper Document Positioning

For optimal Document Verification and OCR data extraction, it is crucial to have a well-positioned document image where the ID Document object is clear and easily recognisable. If the ID Document within the image is too distant or unclear, it can adversely affect the system's ability to accurately detect and extract the text, potentially leading to errors in data extraction.

<figure><img src="/files/oHv4cUckn9Wr5eyP8luO" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/RhwPipXVQOux3MfjlQJI" alt="" width="563"><figcaption></figcaption></figure>

### Adequate Lighting

In order to achieve accurate text recognition, it is essential to capture document images in adequate lighting conditions. Low lighting conditions can pose challenges for the Document Verification and OCR system to accurately recognize text. Therefore, it is highly recommended to capture document images in good lighting conditions to ensure clear and easily recognizable text.

<figure><img src="/files/noIR6xt9kaYd4KAOglBG" alt="" width="563"><figcaption></figcaption></figure>

### Avoid Glare&#x20;

Glare on the document can interfere with text recognition and lead to errors in data extraction. It is important to avoid glare by taking the document image in an environment with minimal light reflection.

<figure><img src="/files/kkbfsdZMp1CCvF4mT58a" alt="" width="563"><figcaption><p>KTP CARD Illustration - Avoid Glare</p></figcaption></figure>

<figure><img src="/files/3aOL47cibSpCXTFlwK1T" alt="" width="563"><figcaption><p>Passport Illustration - Avoid Glare</p></figcaption></figure>

### Avoid Defects

Defects in the document image, such as folds, creases, or stains, can interfere with Document Verification and OCR text recognition and lead to errors in data extraction. It is recommended to ensure that the document is clean and free of any defects before scanning or taking the image.

<figure><img src="/files/oYnnloZ8sXxfrhoY7f7j" alt="" width="563"><figcaption><p>KTP CARD Illustration - Avoid Defects</p></figcaption></figure>

<figure><img src="/files/UaQ6eie0QkjZjvf4clve" alt="" width="563"><figcaption><p>Passport Illustration - Avoid Defects</p></figcaption></figure>

### Avoid Blur

A blurry image can disrupt the Document Verification and OCR process and result in errors. Prevent blur by holding your device stable while capturing, using auto-focus, and ensuring the image resolution is high.&#x20;

<figure><img src="/files/hes8NRcqRoaCcUmRjFYi" alt="" width="563"><figcaption></figcaption></figure>

### Image Too Far

Ensuring the correct distance while capturing the image is important. The ID Document needs to be clearly visible and fill a significant portion of the image frame for the Document Verification and OCR system to accurately detect and extract the text.

<figure><img src="/files/zinxz8WlHIfPZxBiMslJ" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/lABkp3c27bZfzVUoBhUK" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The ID Document should occupy at least 80% of the entire captured image.
{% endhint %}

### Avoid Cropped Area

A cropped image can disrupt Document Verification and OCR performance and result in the wrong character recognition. The ID Document needs to be clearly visible. If some text areas are cropped, the OCR can not recognize the whole character.&#x20;

<figure><img src="/files/Nxvc0WbjO9RuJbwiMD92" alt=""><figcaption><p> Illustration - Avoid KTP Card Getting Cropped</p></figcaption></figure>

<figure><img src="/files/fxp1P98sKTp4m54yFaZ4" alt=""><figcaption><p> Illustration - Avoid Passport Getting Cropped</p></figcaption></figure>

### Avoid ID Card without background or padding

A full-frame image with no padding makes it difficult for the system to detect the ID document properly. Ensure the ID is captured with some space around its edges to improve verification and spoof-detection accuracy.

<figure><img src="/files/L1jzMkT8p5KF5YdWHaC0" alt="" width="563"><figcaption><p>Illustration - Avoid ID Card without background or padding</p></figcaption></figure>

### Image Condition and Recommendation

| Image Condition                                             | Recommendation                                                                                                                                                                                                                |
| ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Ideal Condition                                             | <ul><li>Original KTP, not a copy or screen</li><li>All 4 corners visible, not cropped</li><li>Sharp text (no blur or motion)</li><li>Well lit, no glare or heavy shadows</li><li>Straight and centered in the frame</li></ul> |
| <p>The Image is rotated<br>and should be avoided</p>        | Capture the image in a horizontal position                                                                                                                                                                                    |
| The image is too far and should be avoided                  | Capture the image from a closer distance or zoom in.                                                                                                                                                                          |
| The image has defects and should be avoided                 | Ensure the ID Document is free of defects before capturing the image.                                                                                                                                                         |
| The image is captured in low lighting and should be avoided | Ensure adequate lighting is present to properly illuminate the ID Document.                                                                                                                                                   |
| The image has glare and should be avoided                   | Position the ID Document and camera to avoid direct light reflection                                                                                                                                                          |
