Skip to content

A Flutter plugin enabling the user to detect edges of a given image. It returns the relative coordinates of the detection rectangle.

License

Notifications You must be signed in to change notification settings

ThunderClapLP/flutter-simple-edge-detection

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple_edge_detection

A Flutter plugin enabling the user to detect edges of a given image. It returns the relative coordinates of the detection rectangle.

Demo

Try out

If you just want to test it, go ahead and clone this repository. Before you can run the example, you need to download the OpenCV library. Download the iOS pack and Android on https://opencv.org/releases/. Afterwards, copy the respective files into the directory of this plugin where project_root is the root folder of this plugin:

# OpenCV for Android
cp -R sdk/native/jni/include project_root
cp sdk/native/libs/* project_root/android/src/main/jniLibs/*

# OpenCV for iOS
cp -R opencv2.framework project_root/ios

Getting Started

Add plugin as dependency

In order to use the package, please verify you have added the latest version to you pubspec.yml:

dependencies:
  flutter:
    sdk: flutter
  simple_edge_detection: local_path_to_this_repository

Import the package in your code

import 'package:simple_edge_detection/edge_detection.dart';

Call the detection using a file path to an image

final picker = ImagePicker();
final pickedFile = await picker.getImage(source: ImageSource.gallery);
final filePath = pickedFile.path;

EdgeDetectionResult result = await EdgeDetector().detectEdges(filePath);

Technical information

This package uses the OpenCV C++ library version 4.4.0 to perform the detection task. It utilizes Dart-FFI to execute the native code.

Tutorial / Infos / Article

Find the respective tutorial about how everything was created and how it's to be used on https://www.flutterclutter.dev/flutter/tutorials/implementing-edge-detection-in-flutter/2020/1509/

About

A Flutter plugin enabling the user to detect edges of a given image. It returns the relative coordinates of the detection rectangle.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 64.9%
  • C++ 22.7%
  • Kotlin 5.1%
  • Ruby 2.7%
  • Swift 1.9%
  • Objective-C 1.6%
  • CMake 1.1%