1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#![allow(
unused_parens,
clippy::excessive_precision,
clippy::missing_safety_doc,
clippy::not_unsafe_ptr_arg_deref,
clippy::should_implement_trait,
clippy::too_many_arguments,
clippy::unused_unit,
)]
use crate::{mod_prelude::*, core, sys, types};
pub mod prelude {
pub use { super::WBDetector };
}
pub trait WBDetector {
fn as_raw_WBDetector(&self) -> *const c_void;
fn as_raw_mut_WBDetector(&mut self) -> *mut c_void;
fn read(&mut self, node: &core::FileNode) -> Result<()> {
unsafe { sys::cv_xobjdetect_WBDetector_read_const_FileNodeR(self.as_raw_mut_WBDetector(), node.as_raw_FileNode()) }.into_result()
}
fn write(&self, fs: &mut core::FileStorage) -> Result<()> {
unsafe { sys::cv_xobjdetect_WBDetector_write_const_FileStorageR(self.as_raw_WBDetector(), fs.as_raw_mut_FileStorage()) }.into_result()
}
fn train(&mut self, pos_samples: &str, neg_imgs: &str) -> Result<()> {
extern_container_arg!(pos_samples);
extern_container_arg!(neg_imgs);
unsafe { sys::cv_xobjdetect_WBDetector_train_const_stringR_const_stringR(self.as_raw_mut_WBDetector(), pos_samples.opencv_as_extern(), neg_imgs.opencv_as_extern()) }.into_result()
}
fn detect(&mut self, img: &core::Mat, bboxes: &mut core::Vector::<core::Rect>, confidences: &mut core::Vector::<f64>) -> Result<()> {
unsafe { sys::cv_xobjdetect_WBDetector_detect_const_MatR_vector_Rect_R_vector_double_R(self.as_raw_mut_WBDetector(), img.as_raw_Mat(), bboxes.as_raw_mut_VectorOfRect(), confidences.as_raw_mut_VectorOff64()) }.into_result()
}
}
impl dyn WBDetector + '_ {
pub fn create() -> Result<core::Ptr::<dyn crate::xobjdetect::WBDetector>> {
unsafe { sys::cv_xobjdetect_WBDetector_create() }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::xobjdetect::WBDetector>::opencv_from_extern(r) } )
}
}