> 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/document-ai/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="316.1630859375">Image Setting</th><th>Requirement</th></tr></thead><tbody><tr><td>Minimum camera pixel</td><td>Above 2 MP</td></tr><tr><td>Image file size</td><td><p>Minimum size: 100 KB</p><p>Maximum size : 2 MB</p></td></tr><tr><td>Image Compression Recommendation</td><td>Bicubic, with minimum JPEG quality 80%</td></tr><tr><td>Image Dimension</td><td><p>Minimum Dimension : 300 x 400 px</p><p>Maximum Dimension : 4000x3000 px</p></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><tr><td>Extra Padding</td><td>Extra padding of 30 pixels in each card bounding box</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=""><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=""><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=""><figcaption></figcaption></figure>

<figure><img src="/files/RhwPipXVQOux3MfjlQJI" alt=""><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=""><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=""><figcaption><p>KTP CARD Illustration - Avoid Glare</p></figcaption></figure>

<figure><img src="/files/3aOL47cibSpCXTFlwK1T" alt=""><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=""><figcaption><p>KTP CARD Illustration - Avoid Defects</p></figcaption></figure>

<figure><img src="/files/UaQ6eie0QkjZjvf4clve" alt=""><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=""><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/a0qzznDfF4fYrADjspDS" alt="" width="563"><figcaption></figcaption></figure>

### Passport Photo Framing Requirement&#x20;

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

To ensure the system classifies your upload correctly as a *cropped document*, please follow these framing rules:

* **Fill ratio:** The passport should occupy **approximately 60–70% of the image**.
* **Context space:** Leave **up to \~40%** of the image as background/context around the passport (a visible border on all sides).
* **Keep all edges visible:** Make sure the **entire passport is in frame**, including all corners (no cut-offs).
* **Positioning:** Place the passport **centered** and keep it **flat** (avoid tilt, strong perspective).
* **Image quality:** Use **good lighting**, avoid glare/shadows, and keep the passport details readable.

**Common mistakes to avoid**

* Too close: passport fills **>70–80%** of the image (tight crop, little/no border).
* Too far: passport fills **<60%** of the image (too much background).

### Image Condition and Recommendation

| Image Condition                                             | Recommendation                                                              |
| ----------------------------------------------------------- | --------------------------------------------------------------------------- |
| Ideal Condition                                             | NA                                                                          |
| <p>The Image is rotated<br>and should be avoided</p>        | Capture the image in a horizontal position                                  |
| <p>The Image is rotated<br>and should be avoided</p>        | Capture the image in a horizontal position                                  |
| The image is to 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        |

### Landmark Verification (Cropped Card Detection)

The guidelines above describe how to capture a good image. **Landmark Verification** is the automated check that enforces them for KTP: it confirms the card is well framed and is actually a KTP before the document moves into OCR and identity verification. When the card's content is cut off at the edge of the frame, it returns a clear instruction to recapture.

#### What it checks

Landmark Verification inspects each KTP image and looks for two problems:

* **Cropped content** — the card's text or portrait sits too close to an edge, so detail may be clipped.
* **Incorrect / non-KTP layout** — the landmarks aren't arranged the way a KTP's are, which usually means a different document was submitted.

{% hint style="info" %}
This covers content framing and layout. Objects placed *on top of* the card (full or partial occlusion) and the missing-landmark case are handled separately.
{% endhint %}

#### What your users will see

**✅ Pass - card fully visible**&#x20;

The card and all four landmark anchors (Provinsi, NIK, Name, Portrait) sit comfortably inside the frame. No message is shown and the image proceeds to verification.

**⚠️ Card content too close to the edge**&#x20;

The card text, portrait, province or expiry line sits right against an edge of the image, so detail may be clipped.

{% hint style="info" %}
**Message shown to user:** "Card contents may not be fully visible. Please re-capture the card with all four edges within the frame."

**API component:** `content_close_to_edge`
{% endhint %}

**❌ Layout doesn't match a KTP**&#x20;

The landmarks aren't arranged the way a KTP's are - Provinsi isn't at the top, the portrait isn't on the right, or the field order is off. Typically this means a different document was submitted (for example, a driving license / SIM).

{% hint style="info" %}
**Message shown to user:** "Card may not be a KTP."

**API component:** `component_position`
{% endhint %}

#### How it appears in the API response

Results are returned inside the `landmark_verification` array. Each entry is a named check with a `pass` / `fail` status. Read the individual components to drive your own messaging.

<details>

<summary>Response</summary>

{% code expandable="true" %}

```json
'result': {
    ...
    'landmark_verification': [
        {
            'name': 'content_close_to_edge',
            'status': 'fail'
        },
        {
            'name': 'component_position',
            'status': 'pass'
        }
    ],
    ...
}
```

{% endcode %}

</details>

#### What each component means

| Component                | Role           | Fails When...                                                                               |
| ------------------------ | -------------- | ------------------------------------------------------------------------------------------- |
| content\_close\_to\_edge | Recapture      | The card's content sits too close to any side of the image.                                 |
| component\_position      | Wrong document | The landmark arrangement isn't consistent with a KTP — surfaced as "Card may not be a KTP." |

{% hint style="info" %}
**Tip:**&#x20;

* `content_close_to_edge` asks *"is the capture framed correctly?"*&#x20;
* `component_position` asks *"is this actually a KTP?"*&#x20;
  {% endhint %}
