Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Optional ScanArea GraphicOverlay and Detection Filtering for OCR #66

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

SamuelHaws
Copy link

@SamuelHaws SamuelHaws commented Jan 17, 2021

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

This was referenced Jan 17, 2021
@edufolly
Copy link
Owner

Nice @SamuelHaws, I'll revise asap.

@SamuelHaws
Copy link
Author

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.

@nicolasknz
Copy link

Important feature, shoud be implemented @edufolly

@ghost
Copy link

ghost commented Jul 13, 2021

Please make a pull request to https://github.com/harrowmykel/flutter_mobile_vision_2

He already migrated the plugin to non null.

https://pub.dev/packages/flutter_mobile_vision_2

@ghost
Copy link

ghost commented Jul 20, 2021

Thanks @SamuelHaws . Your code has been implemented in the new version at https://github.com/harrowmykel/flutter_mobile_vision_2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants