> 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). For ID-3 sized documents such as passports, the document must be at least 738 x 520 pixels (about 150 DPI) for the portrait check to run. Additionally, the file size of the image should not exceed 2 MB.

<table><thead><tr><th width="335.234375">Image Setting</th><th>Requirement</th></tr></thead><tbody><tr><td>Resolution</td><td>Recommended: 200 PPI<br>Minimum: 150 DPI (738 x 520 px for ID-3 documents such as passports)</td></tr><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 70–80% of the entire image</td></tr><tr><td>Borders</td><td>All 4 corners clearly visible, with some background around all edges</td></tr><tr><td>documentPositionIndent</td><td>5</td></tr><tr><td>Angle / tilt</td><td>Maximum 15°</td></tr><tr><td>Lighting</td><td>Even, with no overexposed or very dark areas</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 %}

{% hint style="success" %}
**Recommendation:** For better capture quality and more control over the end-to-end transaction, we recommend using the VIDA SDK for document capture instead of uploading images directly through the API.
{% endhint %}

***

### Key Image Quality Recommendations for Document Capture

#### Horizontal Orientation

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.

**Ideal KTP Image**

<figure><img src="https://2033469942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2s0IISjZwzGfw8dm215%2Fuploads%2FBT6CktJxByvWpW2l9Wvq%2Fspaces_zqikP7fR7hLesltIaRUc_uploads_mawyCwLoV3M2akt5z5W0_image.webp?alt=media&amp;token=d9b6f8c4-6dc7-4098-915f-1e14cdc8463d" 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="https://2033469942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2s0IISjZwzGfw8dm215%2Fuploads%2F9gOyiPrbXC59pOqpVbZI%2FMobile%20rotated%20(4).jpg?alt=media&amp;token=40f930c0-e7e1-45bc-9d6b-de1e3e8a83b1" 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, centered, and easily recognisable. If the ID Document within the image is too distant, too close, 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="https://2033469942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2s0IISjZwzGfw8dm215%2Fuploads%2FjK4MfApq9NxnDPadSALV%2Fspaces_zqikP7fR7hLesltIaRUc_uploads_FizJgyU0S8ACdFHVRclE_image.webp?alt=media&amp;token=afceb7e7-c0e1-4d8c-9b03-152977d0da81" alt="" width="563"><figcaption></figcaption></figure>

#### Angle and Tilt

Keep the document flat and hold the camera parallel to its surface. The tilt angle should not exceed 15°. Strong tilt or perspective distortion reduces text recognition accuracy.

<figure><img src="https://2033469942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2s0IISjZwzGfw8dm215%2Fuploads%2Fr4IbbHKNqwylgXphyY5P%2FProper%20Document%20Positioning.jpeg?alt=media&amp;token=91292bdd-15d0-4a99-9089-b26fbaf98230" alt="" width="563"><figcaption></figcaption></figure>

#### Adequate Lighting

In order to achieve accurate text recognition, it is essential to capture document images under even lighting. Avoid overexposed areas that wash out the text, and avoid very dark areas or shadows that make the text hard to read. Low or uneven 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="https://2033469942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2s0IISjZwzGfw8dm215%2Fuploads%2F1ie75CsQ1zeZQ9W8cM3W%2Fimage%20(1).png?alt=media&amp;token=e39d7d69-47fa-4ca8-926b-b14fad1c9a41" alt="" width="563"><figcaption></figcaption></figure>

#### Avoid Glare

Glare or reflections on the document surface 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, and by avoiding direct light on the document.

<figure><img src="https://2033469942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2s0IISjZwzGfw8dm215%2Fuploads%2FcGxyaTbSQfvrdq6CIsjI%2Fimage2.png?alt=media&amp;token=e297b0ec-4aca-4ae2-b9e9-6dd30602ea3a" alt="" width="563"><figcaption><p>KTP CARD Illustration - Avoid Glare</p></figcaption></figure>

<figure><img src="https://2033469942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2s0IISjZwzGfw8dm215%2Fuploads%2FBTumofVZTAP6s4fmhQQW%2FAvoid%20Glare.jpeg?alt=media&amp;token=7a6ce2f5-3dab-46ba-81ff-edfc9fad12df" 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="https://2033469942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2s0IISjZwzGfw8dm215%2Fuploads%2FHqqqiu1umrtyqIoHpI2s%2Fimage%20(2).png?alt=media&amp;token=1ae8ead9-20a1-43ab-a266-28e87b2bd43b" alt="" width="563"><figcaption><p>KTP CARD Illustration - Avoid Defects</p></figcaption></figure>

<figure><img src="https://2033469942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2s0IISjZwzGfw8dm215%2Fuploads%2Ft6BOxSztw80RhK3iWVCq%2FAvoid%20Defects.jpeg?alt=media&amp;token=c6f39ea0-46a5-4914-a7f8-c076a62cd2a7" alt="" width="563"><figcaption><p>Passport Illustration - Avoid Defects</p></figcaption></figure>

#### Avoid Blur

The image must be in focus. 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.

<figure><img src="https://2033469942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2s0IISjZwzGfw8dm215%2Fuploads%2FWUdosQ5P39MMq2fgV3a8%2Fimage%20(3).png?alt=media&amp;token=8bc16be4-226c-4ad3-8225-555d988af97d" 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 should occupy **70–80%** of the entire image for the Document Verification and OCR system to accurately detect and extract the text.

* **Too far (under 70%):** The text becomes too small to be detected and extracted accurately, and the document's effective resolution may fall below the minimum required for the portrait check. Capture the image from a closer distance or zoom in.
* **Too close (over 80%):** There is little or no background around the document, so corners and edges may be clipped. Move the camera back until all 4 corners and some background are visible.

<figure><img src="https://2033469942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2s0IISjZwzGfw8dm215%2Fuploads%2FSNeOIejXMfoahTTCVgug%2Fimage%20(4).png?alt=media&amp;token=40e82d4c-7d16-40a3-9f8b-dac448a74784" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2033469942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2s0IISjZwzGfw8dm215%2Fuploads%2FUhIXYwYprjl3j7o5hFzP%2FToo%20far.jpeg?alt=media&amp;token=265634a5-0397-47fd-826e-d6a960c5554e" alt=""><figcaption></figcaption></figure>

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

#### Avoid Low Resolution

Low-resolution images reduce the accuracy of document checks. The portrait check on ID-3 sized documents (such as passports) requires a minimum resolution of 150 DPI, which is at least 738 x 520 pixels for the document itself. This minimum is built into the portrait check and cannot be disabled, so images below it may fail the check.

To keep the resolution high:

* Capture with a camera of 2 MP or higher, at full resolution.
* Do not downscale, screenshot, or heavily compress the image before upload.
* Keep the document large in the frame (70–80% of the image), as described in the framing guidance below.

#### 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 cannot recognize the whole character.

<figure><img src="https://2033469942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2s0IISjZwzGfw8dm215%2Fuploads%2FGLXxZ2S5800D8rc13WHv%2Fimage%20(5).png?alt=media&amp;token=3b375c20-afbc-4500-a87e-ac41fcbd4e97" alt="" width="563"><figcaption><p> Illustration - Avoid KTP Card Getting Cropped</p></figcaption></figure>

<figure><img src="https://2033469942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2s0IISjZwzGfw8dm215%2Fuploads%2Flw6U9oHPtr09PL4jPj2t%2Fcropped%20passport%20area.jpeg?alt=media&amp;token=a7047317-5672-4d79-afee-cd8faf224b5b" alt="" width="563"><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 all 4 corners clearly visible and some background around all edges to improve verification and spoof-detection accuracy. The document should still stay within 70–80% of the image, so it is neither too tight nor too small.

<figure><img src="https://2033469942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2s0IISjZwzGfw8dm215%2Fuploads%2F9Sw3oQBr9WJ4upLZzACf%2Fimage.png?alt=media&amp;token=230e56cc-8b11-4465-9143-ad5c27ede252" alt="" width="563"><figcaption></figcaption></figure>

### Passport Photo Framing Requirement

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

<figure><img src="https://2033469942-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC2s0IISjZwzGfw8dm215%2Fuploads%2FxJfzGA0wFDCOVKYMTKVy%2Fimage.png?alt=media&amp;token=2bcf3da6-584f-47f2-bf51-328468c9adf8" alt="" width="563"><figcaption></figcaption></figure>

* **Fill ratio:** The passport should occupy approximately **70–80% of the image**.
* **Context space:** Leave approximately **20–30%** of the image as background around the passport, so a visible border remains on all sides.
* **Keep all edges visible:** Make sure the entire passport is in frame, including all 4 corners (no cut-offs).
* **Positioning:** Place the passport centered and keep it flat (maximum tilt of 15°, no strong perspective).
* **Image quality:** Use even lighting, avoid glare and shadows, and keep the passport details readable and in focus.

**Common mistakes to avoid**

* Too close: the passport fills more than 80% of the image (tight crop, little or no border).
* Too far: the passport fills less than 70% of the image (too much background).

***

### Image Condition and Recommendation

| Image Condition                                                                                      | Recommendation                                                                                                   |
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| Ideal Condition                                                                                      | NA                                                                                                               |
| The image is rotated and should be avoided                                                           | Capture the image in a horizontal position                                                                       |
| The image is too far (under 70%) and should be avoided                                               | Capture the image from a closer distance or zoom in                                                              |
| The image is too close (over 80%) or has no background and should be avoided                         | Move back so all 4 corners and some background are visible                                                       |
| The image is tilted more than 15° and should be avoided                                              | Hold the camera parallel to the document                                                                         |
| The image has defects and should be avoided                                                          | Ensure the ID Document is free of defects before capturing the image                                             |
| The image is blurry and should be avoided                                                            | Hold the device steady and use auto-focus                                                                        |
| The image is captured in low, uneven, or overexposed lighting and should be avoided                  | Ensure even, 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                                             |
| The image resolution is too low (below 150 DPI, or 738 x 520 px for passports) and should be avoided | Capture at full camera resolution without downscaling, and move closer so the document fills 70–80% of the image |

***

### 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:

<table><thead><tr><th width="203.18402099609375">Problems</th><th>Description</th></tr></thead><tbody><tr><td><strong>Cropped content</strong></td><td>The card's text or portrait sits too close to an edge, so detail may be clipped.</td></tr><tr><td><strong>Incorrect / non-KTP layout</strong></td><td>The landmarks aren't arranged the way a KTP's are, which usually means a different document was submitted.</td></tr></tbody></table>

{% 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

<table data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>✅ Pass: card fully visible</strong></td><td>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.</td></tr><tr><td><strong>⚠️ Card content too close to the edge</strong></td><td><p></p><p>The card text, portrait, province, or expiry line sits right against an edge of the image, so detail may be clipped.<br><br><strong>Message shown to user:</strong> "Card contents may not be fully visible. Please re-capture the card with all four edges within the frame."</p><p><br><strong>API component:</strong> <code>content_close_to_edge</code></p></td></tr><tr><td><strong>❌ Layout doesn't match a KTP</strong></td><td><p>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).<br><br><strong>Message shown to user:</strong> "Card may not be a KTP."</p><p><br><strong>API component:</strong> <code>component_position</code></p></td></tr></tbody></table>

#### 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>JSON Response</summary>

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

</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:**

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

***

### Recommended Processing Flow

When using the portrait check, we recommend validating the overall image quality first and evaluating the portrait check result only if the image quality check passes.

{% stepper %}
{% step %}
Check the image quality result (`detailsOptical.imageQA`).
{% endstep %}

{% step %}
If it fails, ask the user to recapture the image following the guidelines above. Do not rely on the portrait check result for that image.
{% endstep %}

{% step %}
If it passes, evaluate the portrait check result.
{% endstep %}
{% endstepper %}
