You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. i'm having issues trying to convert an OpenCV Mat to an ndarray, here is my code
use cv_convert::IntoCv;use cv_convert::opencv as cv;use cv_convert::ndarray as nd;fnmain(){let mat = cv::core::Mat::new_rows_cols_with_default(300,300,cv::core::CV_8UC3, cv::core::Scalar::all(1.)).unwrap();let view: nd::ArrayD<u8> = (&mat).into_cv();}
The compiler gives me this error:
--> src/main.rs:10:39
|
10 | let view: nd::ArrayD<u8> = (&mat).into_cv();
| ^^^^^^^ the trait `FromCv<&Mat>` is not implemented for `ArrayBase<OwnedRepr<u8>, cv_convert::ndarray::Dim<IxDynImpl>>`
|
= help: the following other types implement trait `FromCv<T>`:
<OPoint<T, cv_convert::nalgebra::Const<2>> as FromCv<&Point_<T>>>
<OPoint<T, cv_convert::nalgebra::Const<2>> as FromCv<Point_<T>>>
<OPoint<T, cv_convert::nalgebra::Const<3>> as FromCv<&Point3_<T>>>
<OPoint<T, cv_convert::nalgebra::Const<3>> as FromCv<Point3_<T>>>
<Point3_<T> as FromCv<&OPoint<T, cv_convert::nalgebra::Const<3>>>>
<Point3_<T> as FromCv<OPoint<T, cv_convert::nalgebra::Const<3>>>>
<Point<T> as FromCv<&Point_<T>>>
<Point<T> as FromCv<Point_<T>>>
and 116 others
= note: required for `&Mat` to implement `IntoCv<ArrayBase<OwnedRepr<u8>, cv_convert::ndarray::Dim<IxDynImpl>>>`
I'm using rustc 1.69.0 and this is my cargo.toml
[dependencies]
cv-convert = "0.22.0"
The text was updated successfully, but these errors were encountered:
Hello. i'm having issues trying to convert an OpenCV Mat to an ndarray, here is my code
The compiler gives me this error:
I'm using rustc 1.69.0 and this is my cargo.toml
The text was updated successfully, but these errors were encountered: