Skip to content
pubscout

dartcv4

2.3.1, released 2 months ago by rainyl.dev

OpenCV4 bindings for Dart/Flutter using ffi for native computer‑vision functions.

$ flutter pub add dartcv4
Source repository

What it does

The package wraps OpenCV 4 modules and exposes them to Dart via ffi. It lets Flutter apps perform image processing, feature detection, DNN inference and other vision tasks with native performance.

AI-written summary of version 2.3.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need advanced computer‑vision algorithms not available in pure‑Dart libraries
  • Cross‑platform (mobile/desktop) apps require high‑performance image processing

Skip it when

  • Targeting web only where native assets aren't supported
  • You prefer a lightweight pure‑Dart solution

Strengths

  • Comprehensive OpenCV module coverage
  • Native performance via ffi
  • Supports Android, iOS, Windows, macOS, Linux
  • Hooks and code‑gen simplify native asset handling

Weaknesses

  • Requires native build steps and CMake
  • Large binary size
  • Not usable on web platforms

Setup

Kind
FFI (native library)
Effort
High
Code generation
No
Direct dependencies
7

Requires Dart SDK >=3.10, CMake, and native‑assets hooks configuration. May need to adjust deployment_target for iOS/macOS and ensure prebuilt binaries are available or build OpenCV yourself.

import 'package:dartcv/dartcv.dart';

void main() async {
  final img = await Imgcodecs.imread('assets/photo.jpg');
  final gray = Imgproc.cvtColor(img, Imgproc.COLOR_BGR2GRAY);
  Imgcodecs.imwrite('assets/gray.jpg', gray);
}

Alternatives

Packages that do the same job and could replace dartcv4.

  • image

    Pure‑Dart image manipulation library with no native build, suitable for simple processing and web support

Works with

Packages commonly used together with dartcv4: ones it builds on, ones built on it, and its own family.