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

OCR scan andorid + ios #6

Open thunq96 opened 1 month ago

thunq96 commented 1 month ago

I try it scan for andorid and IOS but I see , Android only scan horizontal and IOS only scan vertical. I can andorid + ios scan vertical . Can the library do it?

yushulx commented 1 month ago

@thunq96 the library only provides algorithm API. https://github.com/yushulx/flutter_ocr_sdk/blob/main/example/lib/camera/camera_manager.dart

mrzDetector.recognizeByBuffer(bytes, width, height, stride, format)

Android only scan horizontal and IOS only scan vertical.

The scanning orientation is determined by the Flutter camera plugin. On Android, the format of the acquired camera frame is NV21, which means it is rotated by 90°, whereas on iOS, the format of the image is bgra8888. That's why you can scan vertically on iOS.

yushulx commented 1 month ago

@thunq96 how can you scan vertically on both Android and iOS? You can decode NV21 to RGB before calling recognizeByBuffer().

thunq96 commented 1 month ago

@yushulx Thank you, but if I want to scan in multiple dimensions without turning on automatic rotation in the device, can I do that?

thunq96 commented 1 month ago

@yushulx Where Can I get trial key for flutter?

thunq96 commented 1 month ago

I went to the website to request a trial key for mobile but when I added it to flutter it didn't work and it still said No license. Screenshot 2024-03-15 at 15 32 15

yushulx commented 1 month ago

@thunq96 The license key (DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAxLTE2NDk4Mjk3OTI2MzUiLCJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInNlc3Npb25QYXNzd29yZCI6IndTcGR6Vm05WDJrcEQ5YUoifQ==) in my example can work right?