edge_detector 1.0.3 copy "edge_detector: ^1.0.3" to clipboard
edge_detector: ^1.0.3 copied to clipboard

discontinued
PlatformAndroidiOS

Edge detector plugin based on google ml kit object detection. Allows basic edge detection for given image.

edge_detector #

Edge detector plugin based on google ml kit object detection. Allows basic edge detection for given image file.

💡 Please note that this package is just for edge detection. 💡

Check other packages for cropping tools:

  1. auto_crop - available for Android & iOS only.
  2. custom_cropper

Preview #

Example usage #

Basic usage #

Future<void> _detectEdges() async {
    final imageFile = File('path/to/image');
    // Edges that are respective for the original image size.
    final originalImageEdges = await EdgeDetector().detectEdges(imageFile);
    if (originalImageEdges == null) return;

    final topLeft = originalImageEdges.topLeft; // Offset(x,y).
    final topRight = originalImageEdges.topRight; // Offset(x,y).
    final bottomRight = originalImageEdges.bottomRight; // Offset(x,y).
    final bottomLeft = originalImageEdges.bottomLeft; // Offset(x,y).
    final all = originalImageEdges.values; // [topLeft, topRight, bottomRight, bottomLeft].

    // Edges that are respective for the rendered image widget size.
    final widgetEdges = await originalImageEdges.toWidgetEdges(
      imageKey: _imageKey,
      originalImageFile: imageFile,
    );
}

Full example #

Full example showing how to set up and use EdgeDetector. Source code

1
likes
140
points
21
downloads

Publisher

verified publishereterkit.com

Weekly Downloads

Edge detector plugin based on google ml kit object detection. Allows basic edge detection for given image.

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on edge_detector

Packages that implement edge_detector