Open SamuelHaws opened 3 years ago
Nice @SamuelHaws, I'll revise asap.
While this PR is under review, if anyone would like to try it out on their own, you can point your pubspec.yaml to my fork like so:
flutter_mobile_vision:
git:
url: https://github.com/SamuelHaws/flutter_mobile_vision
After adding the above dependency, you may need to run flutter pub upgrade
and flutter clean
.
Important feature, shoud be implemented @edufolly
Please make a pull request to https://github.com/harrowmykel/flutter_mobile_vision_2
He already migrated the plugin to non null.
Thanks @SamuelHaws . Your code has been implemented in the new version at https://github.com/harrowmykel/flutter_mobile_vision_2
Allows users to specify the width and height of a rectangular "scan area" when calling FlutterMobileVision methods, like so:
FlutterMobileVision.read(camera: _ocrCamera, waitTap: true, scanArea: Size(400, 250));
Default scan area size is Size(0,0). When starting the CameraSourcePreview, a check is ran on scanArea dimensions. If either width or height is zero, the actual scanArea graphic is not added to the ScanAreaOverlay. The presence of this graphic is checked in OcrGraphicTracker. If a scan area graphic is found, text graphics will only be tracked / added to overlay if they are within the scan area. If no scan area graphic is found, the OCR detector operates on default behavior.
Admittedly, I have only used this forked version using
FlutterMobileVision.read(...)
with OCR. Additional testing is necessary with other methods (scan, face, etc.) and vision activities (barcode, face, etc.). However, I needed this feature for my own usage, and have seen several Issues associated with requests for this feature. Hopefully this is a good start for those who wish to make use of such a feature. Example screenshot of scan area