A package that detects if an image is a Vietnamese citizen ID using Tesseract.js
npm install ngx-image-id-detectorngx-image-id-detector is an Angular library for detecting whether an image is a Vietnamese Citizen ID card (CCCD) using OCR (Tesseract.js). It can distinguish between the front side, back side, or unrecognized images.
* โ
Detects the front side of CCCD
* โ
Detects the back side of CCCD
* โ Distinguishes invalid images (blurred, glare, cropped, not CCCD)
* ๐ Supports Vietnamese language with Tesseract.js (lang: vie)
* ๐ Returns results as Observable, suitable for Angular
---
``bash`
npm install ngx-image-id-detector tesseract.js
---
| ngx-image-id-detector | Angular version | Tesseract.js version |
| --------------------- | --------------- | -------------------- |
| 1.x | 16+ | 4.x |
| 0.x | 13โ15 | 2.x |
---
Demo source is available in the example/ folder:
`ts
import { DetectIdService } from 'ngx-image-id-detector';
constructor(private detectIdService: DetectIdService) {}
onImageSelected(file: File) {
this.detectIdService.detect(file).subscribe(result => {
console.log(result);
});
}
`
`ts``
interface DetectIdResult {
side: 'front' | 'back' | 'unknown';
text: string;
}
---
๐ https://github.com/nguyentrunghieutcu/ngx-image-id-detector
---