Rust bindings for the OpenCV computer vision library, enabling Rust developers to leverage OpenCV's capabilities.
opencv-rust is a Rust crate that provides bindings for the OpenCV computer vision library. It enables Rust developers to use OpenCV's extensive image processing, computer vision, and machine learning algorithms directly from Rust code. The project translates OpenCV's C++ API into a Rust-friendly interface, though it notes the API is still unstable and not fully battle-tested.
Rust developers who need computer vision capabilities, such as those working on image analysis, real-time video processing, or machine learning applications that require vision features.
It offers a direct path to use the industry-standard OpenCV library from Rust, avoiding the need to write C++ code or create custom bindings. While it doesn't guarantee full Rust safety, it provides a more ergonomic interface than raw FFI and is actively developed with support for multiple OpenCV versions.
Rust bindings for OpenCV
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Wraps a significant portion of the OpenCV C++ API across core modules like imgproc and highgui, as highlighted in the key features, allowing access to extensive computer vision functionality.
Supported on Linux, macOS, and Windows with detailed CI scripts for each platform, ensuring developers can deploy across major operating systems.
Compatible with OpenCV versions 3.4, 4.x, and preliminary 5.x, providing flexibility for different OpenCV installations and future upgrades.
Most functions return Result types to handle potential C++ exceptions, integrating with Rust's error patterns for better reliability.
The README explicitly states the API is 'unstable and not very battle-tested,' making it risky for production use and prone to breaking changes.
Requires installing OpenCV and Clang system-wide, along with configuring multiple environment variables, which can be error-prone and time-consuming.
The project advises treating safety similarly to C++, with issues like mutable reference sharing in Mat objects and callback leaks, undermining Rust's memory safety guarantees.