opencv_dart
2.2.2, released 3 months ago by rainyl.dev
Flutter bindings for OpenCV4 using dart:ffi.
What it does
Provides Dart/Flutter access to OpenCV4 core and contrib modules via FFI. Enables image, video, and computer‑vision processing on Android, iOS, Windows, macOS and Linux.
AI-written summary of version 2.2.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need high‑performance native computer‑vision algorithms
- You require OpenCV modules like DNN, feature detection, or video I/O
- Your app runs on supported desktop or mobile platforms
Skip it when
- You target web only (no native assets)
- You prefer a pure‑Dart solution with smaller binary size
- You want to avoid potential FFmpeg licensing issues
Strengths
- Broad coverage of OpenCV modules
- Cross‑platform native performance
- Supports both core and many contrib modules
Weaknesses
- Requires native build steps and CMake configuration
- Large binary size and possible licensing concerns with FFmpeg
- Not usable on web platforms
Setup
- Kind
- Flutter widgets
- Effort
- High
- Code generation
- No
- Direct dependencies
- 1
Requires Dart SDK >=3.10 (Flutter 3.38), enables native‑assets hooks, may need to install CMake and configure custom cmake generator, ensure platform SDKs are present, watch out for FFmpeg licensing when using video modules
import 'package:opencv_dart/opencv_dart.dart';
void main() async {
final img = await Imgcodecs.imread('assets/sample.jpg');
final gray = await Imgproc.cvtColor(img, Imgproc.COLOR_BGR2GRAY);
await Imgcodecs.imwrite('assets/gray.jpg', gray);
}Alternatives
Packages that do the same job and could replace opencv_dart.
Works with
Packages commonly used together with opencv_dart: ones it builds on, ones built on it, and its own family.
- dartcv4opencv_dart depends on itOpenCV4 bindings for Dart/Flutter using ffi for native computer‑vision functions.
- face_detection_tfliteBuilt on opencv_dartAdvanced face & landmark detection, embedding and segmentation using on-device LiteRT (formerly TensorFlow Lite) models.
- pose_detectionBuilt on opencv_dartPose, person and landmark detection using on-device LiteRT (formerly TensorFlow Lite) models.
- hand_detectionBuilt on opencv_dartOn‑device hand detection, landmarks and gesture recognition using LiteRT models.