enable dnn layer create methods
MODIFY
gen_rust.py
gen_rust.py
@@ -17,7 +17,7 @@ from urllib.parse import quote
# fixme VectorOfMat::get allows to mutate?
# fixme get comments from HOUGH_PROBABILISTIC in imgproc
# fixme get multiline comments from LSD_REFINE_ADV in imgproc
-# fixme implement PtrOf<Trait> see https://docs.opencv.org/3.4.7/d8/d53/classcv_1_1dnn_1_1CropAndResizeLayer.html#a8a42c6fa064f2071f58954c7723bd033
+# fixme add support for InputArray and friends to allow passing UMat
def template(text):
"""
@@ -99,6 +99,7 @@ decls_manual_pre = {
],
"dnn": [
("class cv.dnn.LayerParams", "", ["/Ghost"], []),
+ ("class cv.dnn.Layer", "", ["/Ghost", "/A"], []),
],
}

MODIFY
tests/dnn.rs
tests/dnn.rs
@@ -2,7 +2,7 @@ use matches::assert_matches;
use opencv::{
core,
- dnn::{Dict, DictValue, LayerParams, Net},
+ dnn::{Dict, DictValue, Layer, LayerParams, Net},
Error,
prelude::*,
Result,
@@ -38,6 +38,21 @@ fn net() -> Result<()> {
Ok(())
}
+#[test]
+#[cfg(not(feature = "opencv-32"))]
+fn layer() -> Result<()> {
+ #[cfg(not(feature = "opencv-32"))]
+ {
+ use opencv::dnn::CropAndResizeLayer;
+ let mut params = LayerParams::default()?;
+ params.set("width", &mut DictValue::from_i32(32)?)?;
+ params.set("height", &mut DictValue::from_i32(32)?)?;
+ let layer = CropAndResizeLayer::create(&mut params)?;
+ assert_eq!(0, layer.preferable_target()?);
+ }
+ Ok(())
+}
+
#[test]
#[cfg(not(feature = "opencv-32"))]
fn dict() -> Result<()> {

enable dnn layer create methods