docs.rs failed to build opencv-sdk-4.8.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
OpenCV SDK for Rust
OpenCV SDK provides a compatibility layer for using OpenCV's Rust implementation with existing C/C++ and Python code. This crate bridges the gap between Rust's safety and performance with legacy codebases that expect OpenCV's traditional API.
Features
- FFI Compatibility: Seamless integration with C/C++ codebases
- Python Bindings: Optional PyO3-based Python interface
- WebAssembly Support: Optional WASM compilation for browser deployment
- Type Safety: Rust's ownership system with familiar OpenCV patterns
- Zero-Copy Operations: Efficient data sharing between languages
Installation
Add this to your Cargo.toml:
[]
= "4.8.0"
# Optional features
= { = "4.8.0", = ["python", "wasm"] }
Usage
Rust API
use *;
use ;
C/C++ Interop
int
Python Bindings (with python feature)
# Create a matrix
=
# Compatible with numpy
=
# Process with existing Python OpenCV code
=
Features
Default Features
- Core SDK functionality
- C/C++ FFI bindings
- Basic type conversions
Optional Features
python: Enable Python bindings via PyO3wasm: Enable WebAssembly supportfull: Enable all optional features
Architecture
The SDK provides three layers of compatibility:
- Rust Layer: Native Rust API using
opencv-core - FFI Layer: C-compatible interface for interop
- Binding Layer: Language-specific bindings (Python, WASM)
Safety
This crate maintains Rust's safety guarantees while providing FFI:
- All FFI functions validate inputs
- Memory is managed automatically where possible
- Clear ownership semantics for shared data
Examples
See the examples directory for more usage patterns:
c_interop.c: C/C++ integration examplepython_binding.py: Python usage examplewasm_demo.html: WebAssembly in browser
Contributing
Contributions are welcome! Please see our contributing guidelines.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Related Crates
opencv-core: Core OpenCV data structuresopencv-wasm: WebAssembly bindings