opencv_ffi 1.0.0 opencv_ffi: ^1.0.0 copied to clipboard
An FFI implementation of OpenCV for Dart
OpenCV FFI #
This package contains an ffi-based implementation of OpenCV in Dart. That is, OpenCV itself is bundled in this repository (as a submodule, in src/opencv
), and must be built first for this package to work.
You can compile OpenCV on any platform, but the process is much simpler on Windows:
- Install Visual Studio. You'll likely already have done this since it's required for Flutter for Windows.
- Run
winbuild.bat
. You'll need to run it withcmake
in your path. You can use theDeveloper Command Prompt for Visual Studio
, which you can find in your path. - OpenCV will be compiled and a few DLLs will be placed in
dist
. This should only take around 5 minutes. - Copy the DLLs to your package's root directory or in your PATH, as Dart/Pub won't be able to find them otherwise.
Usage #
import "package:opencv_ffi/opencv_ffi.dart";
void main() async {
final camera = Camera(0);
try {
while (true) {
camera.showFrame();
}
} finally {
camera.dispose();
}
}
See the docs for more usage.