yushulx / flutter_ocr_sdk

Detect machine-readable zones (MRZ) in passports, travel documents, and ID cards
https://pub.dev/packages/flutter_ocr_sdk
MIT License
14 stars 5 forks source link
dart flutter idcard mrz mrz-scanner ocr passport visa

flutter_ocr_sdk

A wrapper for Dynamsoft OCR SDK with MRZ detection model. It helps developers build Flutter applications to detect machine-readable zones (MRZ) in passports, travel documents, and ID cards.

Try MRZ Detection Example

Mobile: Android and iOS

cd example
flutter run 

Flutter Passport MRZ recognition

Web

cd example
flutter run -d chrome

Flutter MRZ recognition in web

Desktop: Windows and Linux

cd example
flutter run -d windows

# flutter run -d linux

Flutter MRZ OCR in Windows

Supported Platforms

Installation

Add flutter_ocr_sdk as a dependency in your pubspec.yaml file.

dependencies:
    ...
    flutter_ocr_sdk:

One More Step for Web

Include the JavaScript library of Dynamsoft Label Recognizer in your index.html file:

<script src="https://cdn.jsdelivr.net/npm/dynamsoft-label-recognizer@2.2.31/dist/dlr.js"></script>

API Compatibility

Methods Android iOS Windows Linux macOS Web
Future<int?> init(String key) :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
Future<int?> loadModel() :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
Future<List<List<MrzLine>>?> recognizeByFile(String filename) :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
Future<List<List<MrzLine>>?> recognizeByBuffer(Uint8List bytes, int width, int height, int stride, int format) :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:

Usage