搜索插件、代码仓与 APP 分类

插件详情v2.2.2

opencv_dart

用于 Flutter 的 OpenCV4 绑定,使用 dart:ffi。

AndroidiOSmacOSWindowsLinux
近 30 天下载
1.5万
喜欢数
137
Pub 分数
140

安装插件

flutter pub add opencv_dart

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

opencv_dart 通过 dart:ffi 为 Flutter 提供 OpenCV4 绑定,使跨平台应用程序具备计算机视觉和图像处理功能。它允许开发者直接在 Android、iOS、macOS、Windows 和 Linux 上的 Flutter 应用中使用 OpenCV 的丰富算法库——例如图像滤波、目标检测和特征提取。该包将原生 OpenCV 功能与 Dart 代码相连接,通过直接系统调用实现高性能。非常适合将实时摄像头处理、OCR 或高级图像分析集成到移动和桌面应用中。

适合场景

  • 实时图像处理
  • OCR 集成
  • 目标检测
  • 基于摄像头的分析
  • 人脸识别

主要特点

  • 跨平台支持
  • 使用 dart:ffi 提升性能
  • OpenCV4 兼容性
  • 原生 OpenCV 函数访问
  • 轻量级包装

适合对象

  • 需要计算机视觉的Flutter开发人员
  • 需要图像分析的应用程序
  • 移动和桌面视觉项目
  • 原型视觉功能
  • 性能关键的图像处理

使用建议

  • 需要原生 OpenCV 库
  • 可能需要特定于平台的设置
  • 有限的文档
  • 应用包潜在的大小增加
  • 调试原生代码可能很复杂

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

opencv_dart

OpenCV Bindings for Dart Language. Support both asynchronous and synchronous!

Star on Github License: Apache-2.0
Native Assets Build Discord Server
Package Link Description
dartcv4 OpenCV bindings for Dart Language.
opencv_dart OpenCV for Flutter, from 2.x , it is a wrapper of dartcv4 to keep compatibility.

[!NOTE] WIP, APIs may change in the future, contributions are welcome!

Demos

Screenshot Link
example example
videoio texture renderer
dnn_minist DNN MNIST inference
stitching stitching
stitching camera
stitching videoio

Supported Platforms

Platform Supported Tested Platforms
Android :white_check_mark: :white_check_mark: x86_64, arm64-v8a, armeabi-v7a
iOS :white_check_mark: :white_check_mark: arm64, x64+arm64(Simulator)
Linux :white_check_mark: :white_check_mark: x64, arm64
Windows :white_check_mark: :white_check_mark: x64, arm64
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 :white_check_mark: :white_check_mark:
xobjdetect :white_check_mark: :white_check_mark:
xphoto :x: :x:
quality :white_check_mark: :white_check_mark:
  • :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
  • videoio: cv.VideoCapture from file is not supported yet supported now.

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, cv.COLOR_BGR2GRAY);
  print("${img.rows}, ${img.cols}");

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

see awesome-opencv_dart and share yours

TODO

  • [x] compile libs for android, linux
  • [x] support for iOS, macOS
  • [x] add more examples
  • [ ] documentation
  • [x] modify C wrapper to catch exceptions
  • [x] Native Assets, see native-assets branch
  • [x] async
  • [x] more/full test coverage
  • [x] directly include opencv source code, refactor cmakelists.txt

Contributors

rainyl
rainy liu
abdelaziz-mahdy
Abdelaziz Mahdy
einsitang
爱因斯唐
Gold872
Gold87
diegolopezrm
Diego López
Jiinwoo
JinWoo Jung
westito
westito
heyarny
Arnold Stark
dupuchba
Baptiste DUPUCH
Escaton615
Escaton615
mdeleau
mdeleau
pariterre
Pariterre
lennartalff
Thies Lennart Alff
jasaw
jasaw
totemat
Matteo T.

Acknowledgement

Star History

Star History Chart

License

Apache-2.0 License

所属分类

依赖

依赖清单 1 项

  • dartcv4^2.2.2

源码仓库

使用此插件的项目

暂无相关数据。