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 6 forks source link
dart flutter idcard mrz mrz-scanner ocr passport visa

Flutter MRZ SDK

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

License Key

To use the SDK, you need a license key for Dynamsoft Label Recognizer. Make sure to get your trial or commercial license before using the library.

Try Flutter MRZ Detection Example

cd example
flutter run # for Android
flutter run -d chrome # for Web
flutter run -d windows # for Windows

Flutter Passport MRZ recognition

Supported Platforms

Installation

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

dependencies:
    ...
    flutter_ocr_sdk:

Additional Step for Web

To support web functionality, 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