edge_detection 1.0.5

  • Readme
  • Changelog
  • Example
  • Installing
  • 92

edge_detection #

A flutter plugin to detect edges of objects, scan paper, detect corner, detect rectangle. It allows cropping of the detected object image and returns the path of the cropped image.

Usage: #

Add dependency´╝Ü #

Please check the latest version before installation.

dependencies:
  flutter:
    sdk: flutter
  edge_detection: ^1.0.5

Add the following imports to your Dart code: #

import 'package:edge_detection/edge_detection.dart';

//Make sure to await the call to detectEdge.
String imagePath = await EdgeDetection.detectEdge;

Demo #

Demo

Screenshots #

Android #

iOS #

Using these native implementation
https://github.com/WeTransfer/WeScan

https://github.com/KePeng1019/SmartPaperScan

0.0.1 #

  • Initial release.

1.0.1 #

  • Updated kotlin extension to 1.2.51

1.0.2 #

  • Removed unused code.

1.0.3 #

  • Updated to Android X (Thanks to @BugsBunnyBR for the PR)

1.0.4 #

  • Corrected images path for pub.dev readme page.

1.0.5 #

  • Fixed an issue where the user can't use the app alongside of filepicker. (Thanks to @RodrigoPorras for the PR)
  • Migrated the plugin code to Swift5. (Thanks to y-okady for the PR)
  • Fixed some issues that were reported on Github.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:edge_detection/edge_detection.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _imagePath = 'Unknown';

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    String imagePath;
    // Platform messages may fail, so we use a try/catch PlatformException.
    try {
      imagePath = await EdgeDetection.detectEdge;
    } on PlatformException {
      imagePath = 'Failed to get cropped image path.';
    }

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {
      _imagePath = imagePath;
    });
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Plugin example app'),
        ),
        body: new Center(
          child: new Text('Cropped image path: $_imagePath\n'),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  edge_detection: ^1.0.5

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:edge_detection/edge_detection.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
85
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
92
Learn more about scoring.

We analyzed this package on Jul 8, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because:

  • package:edge_detection/edge_detection.dart that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because:

  • package:edge_detection/edge_detection.dart that declares support for platforms: android, ios

Package does not support Flutter platform web

Because:

  • package:edge_detection/edge_detection.dart that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because:

  • package:edge_detection/edge_detection.dart that declares support for platforms: android, ios

Package not compatible with SDK dart

Because:

  • edge_detection that is a package requiring null.

Health issues and suggestions

Document public APIs. (-1 points)

4 out of 4 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8