On-Device ID Card Scanner for KYC: Turn Any Smartphone Into a Secure Onboarding Tool
A smartphone can become a secure ID card scanner for KYC and onboarding without extra hardware or cloud processing.
// Java
OCRStudioSDKInstance engine_instance = OCRStudioSDKInstance.CreateFromPath(<PATH_TO_CONFIGURATION_FILE>);
OCRStudioSDKSession session = engine_instance.CreateSession(<SIGNATURE>,
"{\"session_type\": \"document_recognition\", \"target_group_type\": \"default\", \"target_masks\": \"chn.passport.*\"}");
OCRStudioSDKImage image = OCRStudioSDKImage.CreateFromFile(<PATH_TO_IMAGE>);
session.ProcessImage(image);
OCRStudioSDKResult result = session.CurrentResult();
OCRStudioSDKTarget target = result.TargetByIndex(0);
for (OCRStudioSDKItemIterator item_it = target.ItemsBegin("string"); !item_it.IsEqualTo(target.ItemsEnd("string")); item_it.Step()) {
String name = item_it.Item().Name();
String value = item_it.Item().Value();
}
// C++
std::unique_ptr<ocrstudio::OCRStudioSDKInstance> engine_instance(ocrstudio::OCRStudioSDKInstance::CreateFromPath(<PATH_TO_CONFIGURATION_FILE>));
std::unique_ptr<ocrstudio::OCRStudioSDKSession> session(engine_instance->CreateSession(<SIGNATURE>,
"{\"session_type\": \"document_recognition\", \"target_group_type\": \"default\", \"target_masks\": \"chn.passport.*\"}"));
std::unique_ptr<ocrstudio::OCRStudioSDKImage> image(ocrstudio::OCRStudioSDKImage::CreateFromFile(<PATH_TO_IMAGE>));
session->ProcessImage(*image);
const ocrstudio::OCRStudioSDKResult& result = session->CurrentResult();
const ocrstudio::OCRStudioSDKTarget& target = result.TargetByIndex(0);
for (auto item_it = target.ItemsBegin("string"); item_it != target.ItemsEnd("string"); item_it.Step()) {
std::string name = item_it.Item().Name();
std::string value = item_it.Item().Value();
}
// JavaScript
importScripts("ocrstudiosdk_wasm.js")
const OCRSTUDIOSDK = await OCRStudioSDK(module)
instance = new OCRSTUDIOSDK.OCRStudioSDKInstance(
"{ \"enable_lazy_initialization\": false, \"enable_delayed_initialization\": true, \"initialization_num_threads\": 1}"
)
const spawnedSession = instance.CreateSession(
<SIGNATURE>, "{\"session_type\": \"document_recognition\", \"target_group_type\": \"default\", \"target_masks\": \"chn.passport.*\"}")
// <input type="file" id="file-selector"> must exist in HTML
fileSelector = document.querySelector("#file-selector")
fileSelector.addEventListener('change', async (event) => {
const file = event.target.files[0];
const { buffer, width, height } = await getImageBuffer(file);
const rawData = new Uint8Array(buffer);
let fileBufPtr = 0;
const cap = Math.max(rawData.byteLength * 1.5, 8 * 1024 * 1024);
fileBufPtr = OCRSTUDIOSDK._malloc(cap);
OCRSTUDIOSDK.HEAPU8.set(rawData, fileBufPtr);
const channels = rawData.byteLength / (height * width);
const image = OCRSTUDIOSDK.CreateFromRawBuffer(fileBufPtr, rawData.byteLength, width, height, channels >= 3 ? rawData.byteLength / height : width, channels);
spawnedSession.ProcessImage(image);
const result = spawnedSession.CurrentResult();
});
A smartphone can become a secure ID card scanner for KYC and onboarding without extra hardware or cloud processing.
Passport scanning is now a core part of digital KYC, but businesses no longer need dedicated hardware to capture document data accurately.
Companies building KYC and digital onboarding flows need an automated ID scanner that is secure, fast, and accurate.
Mobile OCR SDK is an on-device document recognition technology designed for integration into mobile and desktop applications. OCR Studio Mobile OCR SDK enables document capture, data extraction, and other OCR capabilities directly inside the application, without relying on external recognition services.
Yes. ID scanning, face matching, and NFC chip reading run locally on the device, so document images, extracted data, and selfies do not need to be sent to external servers. The SDK supports CPU architectures including x86, x86_64, ARMv7, ARMv8, and ARMv9, with AArch32 and AArch64 support.
Mobile OCR SDK can be embedded into iOS and Android applications, including consumer-facing apps and enterprise software for employees and field teams. It can also be deployed across desktop application environments, allowing businesses to add the same OCR capabilities to different application formats.
The SDK supports passport scanning, national ID cards scanning, driver’s license scanning, and residence permits scanning. In total, the SDK supports over 4,000 document templates issued in 240+ countries and territories. It can also be used for bank card scanning, barcode and QR code recognition, face matching, and NFC chip reading.
Yes. Mobile OCR SDK can be combined with OCR Studio NFC chip reading technology. Data retrieved from the RFID/NFC chip can be cross-validated with information extracted from the visual inspection zone (VIZ) and machine-readable zone (MRZ) to identify inconsistencies between document data sources.
Mobile OCR SDK can recognize documents from images, screenshots, and live video streams. The technology is designed for real-world capture conditions and delivers reliable recognition even with blur, glare, shadows, camera movement, imperfect framing, and other common image-quality issues.
Yes. All OCR capabilities can run directly on the device without an internet connection. This makes the SDK suitable for applications used in areas with weak or unstable connectivity, as well as field-service scenarios where network access may be unavailable.
Yes. The SDK can be adapted to different document recognition and identity workflows, including custom requirements for supported documents, extracted data, and integration scenarios.
For comprehensive details about our complete
range of solutions and services.
Or contact our sales team: