Type conversions among famous Rust computer vision libraries. It supports the following crates:
This crate allows crate version selection in Cargo features.
For example, the feature nalgebra_0-30 enables nalgebra 0.30.x.
toml
[dependencies.cv-convert]
version = 'x.y.z'
features = [
'image_0-24',
'opencv_0-69',
'tch_0-8',
'nalgebra_0-31',
'ndarray_0-15',
]
The full feature was available before 0.20 but was removed since 0.21 to avoid bloating and surprising dependency update.
The minimum supported rustc is 1.51. You may use older versions of the crate (>=0.6) in order to use rustc versions that do not support const-generics.
fullopencv_0-69opencv_0-68opencv_0-67opencv_0-66opencv_0-65opencv_0-64opencv_0-63Enable the corresponding feature below if you get libclang shared library is not loaded on this thread! panic.
opencv_0-62-clang-runtimeopencv_0-61-clang-runtimeimage_0-24image_0-23imageproc_0-23ndarray_0-15nalgebra_0-31nalgebra_0-30nalgebra_0-29nalgebra_0-28nalgebra_0-27nalgebra_0-26tch_0-8The crate provides FromCv, TryFromCv, IntoCv, TryIntoCv traits, which are similar to standard library's From and Into.
```rust use cv_convert::{FromCv, IntoCv, TryFromCv, TryIntoCv}; use nalgebra as na; use opencv as cv;
// FromCv
let cvpoint = cv::core::Point2d::new(1.0, 3.0);
let napoints = na::Point2::
// IntoCv
let cvpoint = cv::core::Point2d::new(1.0, 3.0);
let napoints: na::Point2
// TryFromCv let namat = na::DMatrix::fromvec(2, 3, vec![1.0, 2.0, 3.0, 4.0, 5.0, 6.0]); let cvmat = cv::core::Mat::tryfromcv(&namat)?;
// TryIntoCv let namat = na::DMatrix::fromvec(2, 3, vec![1.0, 2.0, 3.0, 4.0, 5.0, 6.0]); let cvmat: cv::core::Mat = namat.tryintocv()?; ```
MIT license. See LICENSE file.