Skip to main content

ID Card Auto-Capture

The SDK finds a Thai National ID card in the live camera feed, captures a sharp, flattened image and sends it to the Thai National ID Card OCR API: 1.25 IC for the front, 0.75 IC for the back.

Call​

import 'package:iapp_ekyc_sdk/iapp_ekyc_sdk.dart';

final client = IappEkycClient(apiKey: 'YOUR_API_KEY');

// Front side
final front = await DocumentCaptureView.start(
context,
client: client,
documentType: DocumentType.thaiIdFront,
locale: EkycLocale.th,
);

// Back side (laser code)
final back = await DocumentCaptureView.start(
context,
client: client,
documentType: DocumentType.thaiIdBack,
);

Install: Getting started for Flutter and Web, iOS, Android & React Native for the native wrappers and camera permission.

Options​

  • documentType: thaiIdFront for the front, thaiIdBack for the back with the laser code (DocumentType.thaiIdFront in Flutter).
  • locale: the on-screen language, en, th or zh (EkycLocale.th in Flutter).

Result​

The result has typed fields plus the raw OCR response in result.raw (result.document?.rawJSON on iOS). Field list: Thai National ID Card OCR API.

How auto-capture works
  • Boundary: a four-sided shape in the on-screen guide matching the ID-1 card aspect ratio of 1.586 (85.60 × 53.98 mm), within ±0.25.
  • Stability: the card must stay steady across recent frames, its corners drifting less than 2% of the frame diagonal.
  • Sharpness: blurry frames are rejected before any credit is spent.
  • Perspective correction: the corners are warped to a flat card image of about 300 DPI (1011 × 637 px) before upload.
  • Manual fallback: a shutter button appears after 10 seconds if auto-capture has not fired.

The full algorithm specification is in the SDK source.

© 2026 iApp Technology Co., Ltd.TermsPrivacyStatussale@iapp.co.th