opencv_ffi 2.0.0 copy "opencv_ffi: ^2.0.0" to clipboard
opencv_ffi: ^2.0.0 copied to clipboard

discontinuedreplaced by: opencv_dart

An FFI implementation of the C++ OpenCV library in Dart, with video I/O, image encodings and processing, and some GUI elements.

example/example.dart

// ignore_for_file: avoid_print

import "dart:io";
import "package:opencv_ffi/opencv_ffi.dart";

const fpsDelay = Duration(milliseconds: 1000 ~/ 60);  // 60 FPS

void main() async {
  final camera = Platform.isWindows 
    ? Camera.fromIndex(0) 
    : Camera.fromName("/dev/video0");

  if (!camera.isOpened) {
    print("Could not open camera");
    return;
  }
    
  while (true) {
    try {
      camera.showFrame();
      await Future<void>.delayed(fpsDelay);
    } on CameraReadException {
      print("Could not read camera");
      break;
    }
  }
  camera.dispose();
}
18
likes
150
pub points
66%
popularity

Publisher

unverified uploader

An FFI implementation of the C++ OpenCV library in Dart, with video I/O, image encodings and processing, and some GUI elements.

Homepage
Repository (GitHub)
View/report issues

Topics

#ffi #opencv #video #image #camera

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

ffi

More

Packages that depend on opencv_ffi