dartcv4 2.1.0-dev.2 copy "dartcv4: ^2.1.0-dev.2" to clipboard
dartcv4: ^2.1.0-dev.2 copied to clipboard

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

opencv_dart #

OpenCV Bindings for Dart Language.

Star on Github License: Apache-2.0
Native Assets Build Discord Server

Important

v2.x is prepared for Native Assets, Use only if you know what you are doing!

Usage:

for pure dart:

  1. take a look at https://pub.dev/packages/dartcv4/versions and find the latest version, e.g., 2.0.0-dev.2
  2. add to your pubspec.yaml
  3. dart --enable-experiment=native-assets run <path-to-your-code>

for flutter:

  1. use main channel of Flutter
  2. take a look at https://pub.dev/packages/dartcv4/versions and find the latest version, e.g., 2.0.0-dev.2
  3. add to your pubspec.yaml
  4. flutter config --enable-native-assets
  5. flutter run

Note

WIP, contributions are welcome!

Example #

example

Supported Platforms #

Platform Supported Tested Prebuilt Binaries
Android x86_64, arm64-v8a, armeabi-v7a
iOS arm64, x64(Simulator)
Linux x64
Windows x64
macOS x64, arm64

Status #

Core Modules #

module Binding status Test status description
core Core module
calib3d Calib3D module
dnn DNN module
features2d Features2D module
gapi GAPI module
highgui HighGUI module
imgcodecs ImageCodecs module
imgproc ImageProc module
ml ML module
objdetect Object Detection module
photo Photo module
stitching ☑️ ☑️ Stitching module
svd SVD module
video Video module
videoio VideoIO module

Contrib Modules #

module Binding status Test status description
aruco ArUco module
img_hash Image hashing module
cuda
wechat_qrcode
bgsegm
superres
xfeatures2d
ximgproc
xobjdetect
xphoto
quality
  • ❌ : not finished
  • ☑️ : partially supported
  • ✅ : finished
  • modules not in the above table are not considered, contributions are welcome
  • VideoIO and HighGUI modules dynamically linked FFMPEG, you should be careful with the license, this project takes no responsibility for the license.

Usage #

Pure Dart

import 'package:dartcv4/dartcv.dart' as cv;

void main() {
  final img = cv.imread("test/images/lenna.png", flags: cv.IMREAD_COLOR);
  final gray = cv.cvtColor(img, gray, cv.COLOR_BGR2GRAY);
  print("${img.rows}, ${img.cols}");

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

Flutter

see example

More examples are on the way... see opencv_dart.examples and share yours

TODO #

  • ✅ compile libs for android, linux
  • ✅ support for iOS, macOS
  • ✅ add more examples
  • ❌ documentation
  • ✅ modify C wrapper to catch exceptions
  • ✅ Native Assets
  • ✅ async?
  • ✅ more/full test coverage
  • ✅ directly include opencv source code, refactor cmakelists.txt

Contributors #

rainyl
rainy liu
abdelaziz-mahdy
Abdelaziz Mahdy
einsitang
爱因斯唐
Gold872
Gold87
Jiinwoo
JinWoo Jung
westito
westito
Escaton615
Escaton615
mdeleau
mdeleau
lennartalff
Thies Lennart Alff
totemat
Matteo T.

Acknowledgement #

Star History #

Star History Chart

License #

Apache-2.0 License

6
likes
140
points
4.8k
downloads

Publisher

verified publisherrainyl.dev

Weekly Downloads

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

Repository (GitHub)
View/report issues
Contributing

Topics

#opencv #image #ffi #flutter

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

code_assets, data_assets, ffi, hooks, logging, native_toolchain_cmake, path, yaml

More

Packages that depend on dartcv4