opencv_dart
OpenCV Bindings for Dart Language.
Important
v2.x
is prepared for Native Assets, Use only if you know what you are doing!
v2.x
doesn't need to download the prebuild binaries but requires Native Assets
feature, which is still experimental, see more here: https://github.com/dart-lang/sdk/issues/50565
conan and cmake are required
Usage:
for pure dart:
- take a look at https://pub.dev/packages/opencv_dart/versions and find the latest version, e.g.,
2.0.0-dev.2
- add to your
pubspec.yaml
dart --enable-experiment=native-assets run <path-to-your-code>
for flutter:
- take a look at https://pub.dev/packages/opencv_dart/versions and find the latest version, e.g.,
2.0.0-dev.2
- add to your
pubspec.yaml
flutter config --enable-native-assets
flutter run
Note
WIP, contributions are welcome!
Example
Supported Platforms
Platform | Supported | Tested | Prebuilt Binaries |
---|---|---|---|
Android | :white_check_mark: | :ballot_box_with_check: | x86_64, arm64-v8a, armeabi-v7a |
iOS | :white_check_mark: | :ballot_box_with_check: | arm64, x64(Simulator) |
Linux | :white_check_mark: | :white_check_mark: | x64 |
Windows | :white_check_mark: | :white_check_mark: | x64 |
macOS | :white_check_mark: | :white_check_mark: | x64, arm64 |
Status
Core Modules
module | Binding status | Test status | description |
---|---|---|---|
core | :white_check_mark: | :white_check_mark: | Core module |
calib3d | :white_check_mark: | :white_check_mark: | Calib3D module |
dnn | :white_check_mark: | :white_check_mark: | DNN module |
features2d | :white_check_mark: | :white_check_mark: | Features2D module |
gapi | :x: | :x: | GAPI module |
highgui | :white_check_mark: | :white_check_mark: | HighGUI module |
imgcodecs | :white_check_mark: | :white_check_mark: | ImageCodecs module |
imgproc | :white_check_mark: | :white_check_mark: | ImageProc module |
ml | :x: | :x: | ML module |
objdetect | :white_check_mark: | :white_check_mark: | Object Detection module |
photo | :white_check_mark: | :white_check_mark: | Photo module |
stitching | :ballot_box_with_check: | :ballot_box_with_check: | Stitching module |
svd | :white_check_mark: | :white_check_mark: | SVD module |
video | :white_check_mark: | :white_check_mark: | Video module |
videoio | :white_check_mark: | :white_check_mark: | VideoIO module |
Contrib Modules
module | Binding status | Test status | description |
---|---|---|---|
aruco | :white_check_mark: | :white_check_mark: | ArUco module |
img_hash | :white_check_mark: | :white_check_mark: | Image hashing module |
cuda | :x: | :x: | |
wechat_qrcode | :white_check_mark: | :white_check_mark: | |
bgsegm | :x: | :x: | |
superres | :x: | :x: | |
xfeatures2d | :x: | :x: | |
ximgproc | :x: | :x: | |
xobjdetect | :x: | :x: | |
xphoto | :x: | :x: |
- :x: : not finished
- :ballot_box_with_check: : partially supported
- :white_check_mark: : finished
- modules not in the above table are not considered, contributions are welcome
Usage
Pure Dart
import 'package:opencv_dart/opencv_dart.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
x
compile libs for android, linuxx
support for iOS, macOSx
add more examplesx
modify C wrapper to catch exceptionsx
Native Assetsx
more/full test coveragex
directly include opencv source code, refactor cmakelists.txt
Contributors
rainy liu |
Abdelaziz Mahdy |
JinWoo Jung |
mdeleau |
Matteo T. |
Acknowledgement
gocv
project: github.com/hybridgroup/gocv License: Apache-2.0
Star History
License
Apache-2.0 License