cv-convert
Type conversions among famous Rust computer vision libraries. It supports the following crates:
Usage
This crate allows crate version selection in Cargo features.
For example, the feature nalgebra_0-30 enables nalgebra 0.30.x.
[]
= 'x.y.z'
= [
'image_0-24',
'opencv_0-66',
'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.
Cargo Features
Include everything
full
opencv
opencv_0-68opencv_0-67opencv_0-66opencv_0-65opencv_0-64opencv_0-63
Enable 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-runtime
image
image_0-24image_0-23
imageproc
imageproc_0-23
ndarray
ndarray_0-15
nalgebra
nalgebra_0-31nalgebra_0-30nalgebra_0-29nalgebra_0-28nalgebra_0-27nalgebra_0-26
tch
tch_0-8
Usage
The crate provides FromCv, TryFromCv, IntoCv, TryIntoCv traits, which are similar to standard library's From and Into.
use ;
use nalgebra as na;
use opencv as cv;
// FromCv
let cv_point = new;
let na_points = from_cv;
// IntoCv
let cv_point = new;
let na_points: Point2 = cv_point.into_cv;
// TryFromCv
let na_mat = from_vec;
let cv_mat = try_from_cv?;
// TryIntoCv
let na_mat = from_vec;
let cv_mat: Mat = na_mat.try_into_cv?;
License
MIT license. See LICENSE file.