Crate cv_convert[−][src]
Expand description
Data conversion among computer vision libraries.
Traits
The traits FromCv and IntoCv respectively define .from_cv()
and .into_cv()
methods.
The usage is similar to std’s From and Into. The traits TryFromCv and TryIntoCv are fallible counterparts.
They respective define .try_from_cv()
and .try_into_cv()
methods. These traits can be imported from prelude.
use cv_convert::prelude::*;
Supported conversions
The notations are used for simplicity.
S -> T
suggests the conversion is defined by non-fallible FromCv.S ->? T
suggests the conversion is defined by fallible TryFromCv.(&)T
means the type can be either owned or borrowed.&'a S -> &'a T
suggests that the target type borrows the source type.
opencv -> opencv
std -> tch
- owned/borrowed multi-dimensional array ->? Tensor
- (&)[T; N] ->? Tensor
- (&)[[T; N2]; N1] ->? Tensor
- … and so on up to 6 dimensions
tch -> std
- &’a Tensor -> &’a multi-dimensional array
- &’a Tensor -> &’a [T; N]
- &’a Tensor -> &’a [[T; N2]; N1]
- … and so on up to 6 dimensions
- (&)Tensor -> owned multi-dimensional array
- (&)Tensor ->? [T; N]
- (&)Tensor ->? [[T; N2]; N1]
- … and so on up to 6 dimensions
tch -> ndarray
ndarray -> tch
image -> tch
- (&)ImageBuffer ->? Tensor
- (&)DynamicImage ->? Tensor
image -> opencv
- (&)ImageBuffer ->? Mat
- (&)DynamicImage ->? Mat
opencv -> nalgebra
- (&)Mat ->? OMatrix
- (&)Point_
-> Point2 - (&)Point3_
-> Point2 - (&)OpenCvPose<(&)Point3d> ->? Isometry3
- (&)OpenCvPose<(&)Mat> ->? Isometry3
nalgebra -> opencv
- (&)OMatrix ->? Mat
- (&)Point2
-> Point_ - (&)Point3
-> Point3_ - (&)Translation<N, D> ->? Mat
- (&)Isometry3
->? OpenCvPose<Point3_ > - (&)Isometry3
->? OpenCvPose - (&)Isometry3
->? OpenCvPose
opencv -> tch
- (&)Mat ->? Tensor
- Mat ->? TensorFromMat
tch -> opencv
- (&)Tensor ->? Mat
- (&)TensorAsImage ->? Mat
Re-exports
Modules
Structs
A pair of rvec and tvec from OpenCV, standing for rotation and translation.
A tensor with image shape convention that is used to convert to Tensor.
Enums
Describes the image channel order of a Tensor.