opencv_dart 0.1.0 copy "opencv_dart: ^0.1.0" to clipboard
opencv_dart: ^0.1.0 copied to clipboard

retracted

OpenCV4 bindings for Dart language and Flutter, using dart:ffi. The most complete OpenCV bindings for Dart!

opencv_dart #

OpenCV Bindings for Dart Language.

!!!This package is experiment and APIs may change in the future!!!

Many tests unfinished, contributions are welcome!

Prebuilt binaries for Linux and Windows are available, for other platforms, you have to build them your self.

IMPORTANT

After added to pubspec.yaml or install by commandline, please run dart run opencv_dart:setup -p <platform> to download prebuilt binaries, for now, platform supports auto, linux and windows.

Status #

module Binding status Test status description
aruco ArUco module
core Core module
features2d Features2D module
highgui HighGUI module
imgcodecs ImageCodecs module
imgproc ImageProc module
objdetect Object Detection module
svd SVD module
video Video module
videoio ☑️ VideoIO module
asyncarray AsyncArray module
calib3d Calib3D module
dnn DNN module
photo Photo module
cuda CUDA module
contrib Contrib module
  • ❌ : not finished
  • ☑️ : almost finished
  • ✅ : finished
  • videoio: cv.VideoCapture from file is not supported yet

Usage #

import 'package:opencv_dart/opencv_dart.dart' as cv;

final img = cv.imread("test/images/lenna.png", flags: cv.IMREAD_COLOR);
final gray = cv.Mat.empty();

cv.cvtColor(img, gray, cv.COLOR_BGR2GRAY);
print("${img.rows}, ${img.cols}");

cv.imwrite("test_cvtcolor.png", gray);

More examples are on the way...

TODO #

  • compile libs for android, linux
  • support for iOS, macOS
  • add more examples
  • modify C wrapper to catch exceptions
  • Native Assets

For Developers #

This package is in heavy development, dynamic libraries for Windows and linux have been compiled, for other platforms, you need to compile it yourself.

How to compile #

  1. clone this repo.
  2. compile opencv, windows: ./scripts/build_opencv.ps1, linux: ./scripts/build_opencv.sh
  3. compile this package along with gocv, windows: ./scripts/build.ps1, linux: ./scripts/build.sh, this will generate libopencv_dart.dll or libopencv_dart.so
  4. copy libs to corresponding platform directorys, i.e., libopencv_dart.dll to windows, libopencv_dart.so to linux. this is necessary for dart and flutter to load the dynamic library.
  5. If you want to test using vscode, add dynamic library path to "dart.env" in settings.json

Acknowledgement #

License #

Apache-2.0 License

39
likes
0
pub points
91%
popularity

Publisher

verified publisherrainyl.dev

OpenCV4 bindings for Dart language and Flutter, using dart:ffi. The most complete OpenCV bindings for Dart!

Repository (GitHub)
View/report issues

Topics

#opencv #image #ffi #flutter

License

unknown (LICENSE)

Dependencies

args, equatable, ffi, flutter, path, plugin_platform_interface, w_common, yaml

More

Packages that depend on opencv_dart