การจับภาพบัตรประชาชนอัตโนมัติ
SDK ช่วยให้กระบวนการถ่ายภาพบัตรประจำตัวประชาชนไทยทั้งหมดเป็นไปโดยอัตโนมัติ: ตรวจจับขอบเขตบัตรในฟีดกล้องสด, รอเฟรมที่คมชัดและเสถียร, แก้ไขมุมมองของภาพที่ครอบตัด, และส่งไปยัง Thai National ID Card OCR API — 1.25 IC สำหรับด้านหน้า, 0.75 IC สำหรับด้านหลัง ไม่ต้องจัดกรอบด้วยตนเอง ไม่ต้องถ่ายใหม่เพราะภาพเบลอ
Flutter
import 'package:iapp_ekyc_sdk/iapp_ekyc_sdk.dart';
final client = IappEkycClient(apiKey: 'YOUR_API_KEY');
// ด้านหน้า
final front = await DocumentCaptureView.start(
context,
client: client,
documentType: DocumentType.thaiIdFront,
locale: EkycLocale.th,
);
// ด้านหลัง (รหัสเลเซอร์)
final back = await DocumentCaptureView.start(
context,
client: client,
documentType: DocumentType.thaiIdBack,
);
Web
import { IappEkyc } from '@iapp-technology/ekyc-sdk';
const ekyc = new IappEkyc({ apiKey: 'YOUR_API_KEY' });
const front = await ekyc.captureDocument({
mount: document.getElementById('ekyc-mount'),
documentType: 'thaiIdFront',
locale: 'th',
});
const back = await ekyc.captureDocument({
mount: document.getElementById('ekyc-mount'),
documentType: 'thaiIdBack',
});
ผลลัพธ์จะแสดงตัวเข้าถึงข้อมูลแบบ typed และการตอบสนอง OCR ดิบ (result.raw) — ดู Thai National ID Card OCR field reference
iOS / Android / React Native
กระบวนการเดียวกันนี้มีอยู่ใน wrapper ดั้งเดิม — เครื่องมือเดียว คุณภาพการจับภาพเหมือนกัน การติดตั้งและการตั้งค่าการอนุญาตเข้าถึงกล้อง: iOS, Android & React Native
// iOS (Swift; Objective-C ก็รองรับ)
let config = IappEkycConfig(apiKey: "YOUR_API_KEY", flow: .documentCapture)
config.documentType = .thaiIdFront
IappEkycSdk.present(from: self, config: config) { result in /* result.document?.rawJSON */ }
// Android (Kotlin; Java ก็รองรับ)
ekyc.launch(IappEkycRequest.DocumentCapture(config, EkycDocumentType.THAI_ID_FRONT))
// React Native
<IappEkycFlow flow="documentCapture" documentType="thaiIdFront" apiKey="YOUR_API_KEY"
onResult={handleResult} onError={handleError} onCancel={close} />