A image feature detector using opencv for IOs and Android.
This plugin uses native versions of OpenCV to detect shapes in given images.
For now it only detects rectangles in given images. It uses native implementations for both IOs and Android for this task.
To use this package add following import to your file:
The API for this package is fairly simple. We can only detect rectangles for now.
If you need more functionalities, feel free to contribute or open an issue in the code repository.
To detect a rectangle in an image save it to a local file and call the
var rectangle = ImageFeatureDetector.detectRectangles(_filePath); // Access the points of the contour rectangle.contour.x; // Access X rectangle.contour.y; // Access the y value.
To detect and transform the image into a normalized image use following api:
var imageData = ImageFeatureDetector.detectAndTransformRectangle(_filePath);
To be as size independent as possible this package uses relative coordinates.
Absolute coordinates would look likes this:
// This values are in Pixels. var p = Point(x: 25, y: 25);
This coordinates are only correct for the original width and height of the image.
If it gets scaled for some reason the above point won't be correct anymore.
To work around this we use relative coordinates. These are values between 0 and 1.
// Would be 25 in a image width 500 width or height var relativePoint = Point(x: 0.05, y: 0.05);
To revert the relative coordinates back to absolute values we can use this helper.
We have to easy methods. One for calculating a single value another for calculating a whole Point.
Calculating one point:
var p = Point(x: 0.05, y: 0.05); var absoluteX = RelativeCoordianteHelper.calculateDistance(p.x, 500); // p.x = 0.05 // absolute value would be 25
Calculating a whole point:
var absolutePoint = RelativeCoordianteHelper.calculatePointDinstances( Point(x: 0.05, y: 0.05), ImageDimensions(500, 500)); // Result Point -> x = 25; y = 25;
Added longer description to pubspec and other fixes from pub
This is the initial release fo this package
Demonstrates how to use the image_feature_detector plugin.
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
Add this to your package's pubspec.yaml file:
dependencies: image_feature_detector: ^0.2.1
You can install packages from the command line:
$ flutter pub get
Alternatively, your editor might support
flutter pub get.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Jul 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter
References Flutter, and has no conflicting libraries.
Support latest dependencies. (-10 points)
The version constraint in
pubspec.yaml does not support the latest published versions for 1 dependency (