pub struct CascadeClassifier { /* private fields */ }
Expand description
@example samples/cpp/facedetect.cpp This program demonstrates usage of the Cascade classifier class \image html Cascade_Classifier_Tutorial_Result_Haar.jpg “Sample screenshot” width=321 height=254
Cascade classifier class for object detection.
Implementations§
Trait Implementations§
Source§impl Boxed for CascadeClassifier
impl Boxed for CascadeClassifier
Source§unsafe fn from_raw(
ptr: <CascadeClassifier as OpenCVFromExtern>::ExternReceive,
) -> Self
unsafe fn from_raw( ptr: <CascadeClassifier as OpenCVFromExtern>::ExternReceive, ) -> Self
Wrap the specified raw pointer Read more
Source§fn into_raw(
self,
) -> <CascadeClassifier as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw( self, ) -> <CascadeClassifier as OpenCVTypeExternContainer>::ExternSendMut
Return the underlying raw pointer while consuming this wrapper. Read more
Source§fn as_raw(&self) -> <CascadeClassifier as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <CascadeClassifier as OpenCVTypeExternContainer>::ExternSend
Return the underlying raw pointer. Read more
Source§fn as_raw_mut(
&mut self,
) -> <CascadeClassifier as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut( &mut self, ) -> <CascadeClassifier as OpenCVTypeExternContainer>::ExternSendMut
Return the underlying mutable raw pointer Read more
Source§impl CascadeClassifierTrait for CascadeClassifier
impl CascadeClassifierTrait for CascadeClassifier
fn as_raw_mut_CascadeClassifier(&mut self) -> *mut c_void
fn cc(&mut self) -> Ptr<BaseCascadeClassifier>
fn set_cc(&mut self, val: Ptr<BaseCascadeClassifier>)
Source§fn read(&mut self, node: &impl FileNodeTraitConst) -> Result<bool>
fn read(&mut self, node: &impl FileNodeTraitConst) -> Result<bool>
Reads a classifier from a FileStorage node. Read more
Source§fn detect_multi_scale(
&mut self,
image: &impl ToInputArray,
objects: &mut Vector<Rect>,
scale_factor: f64,
min_neighbors: i32,
flags: i32,
min_size: Size,
max_size: Size,
) -> Result<()>
fn detect_multi_scale( &mut self, image: &impl ToInputArray, objects: &mut Vector<Rect>, scale_factor: f64, min_neighbors: i32, flags: i32, min_size: Size, max_size: Size, ) -> Result<()>
Detects objects of different sizes in the input image. The detected objects are returned as a list
of rectangles. Read more
Source§fn detect_multi_scale_def(
&mut self,
image: &impl ToInputArray,
objects: &mut Vector<Rect>,
) -> Result<()>
fn detect_multi_scale_def( &mut self, image: &impl ToInputArray, objects: &mut Vector<Rect>, ) -> Result<()>
Detects objects of different sizes in the input image. The detected objects are returned as a list
of rectangles. Read more
Source§fn detect_multi_scale2(
&mut self,
image: &impl ToInputArray,
objects: &mut Vector<Rect>,
num_detections: &mut Vector<i32>,
scale_factor: f64,
min_neighbors: i32,
flags: i32,
min_size: Size,
max_size: Size,
) -> Result<()>
fn detect_multi_scale2( &mut self, image: &impl ToInputArray, objects: &mut Vector<Rect>, num_detections: &mut Vector<i32>, scale_factor: f64, min_neighbors: i32, flags: i32, min_size: Size, max_size: Size, ) -> Result<()>
Detects objects of different sizes in the input image. The detected objects are returned as a list
of rectangles. Read more
Source§fn detect_multi_scale2_def(
&mut self,
image: &impl ToInputArray,
objects: &mut Vector<Rect>,
num_detections: &mut Vector<i32>,
) -> Result<()>
fn detect_multi_scale2_def( &mut self, image: &impl ToInputArray, objects: &mut Vector<Rect>, num_detections: &mut Vector<i32>, ) -> Result<()>
@overload Read more
Source§fn detect_multi_scale3(
&mut self,
image: &impl ToInputArray,
objects: &mut Vector<Rect>,
reject_levels: &mut Vector<i32>,
level_weights: &mut Vector<f64>,
scale_factor: f64,
min_neighbors: i32,
flags: i32,
min_size: Size,
max_size: Size,
output_reject_levels: bool,
) -> Result<()>
fn detect_multi_scale3( &mut self, image: &impl ToInputArray, objects: &mut Vector<Rect>, reject_levels: &mut Vector<i32>, level_weights: &mut Vector<f64>, scale_factor: f64, min_neighbors: i32, flags: i32, min_size: Size, max_size: Size, output_reject_levels: bool, ) -> Result<()>
Detects objects of different sizes in the input image. The detected objects are returned as a list
of rectangles. Read more
Source§fn detect_multi_scale3_def(
&mut self,
image: &impl ToInputArray,
objects: &mut Vector<Rect>,
reject_levels: &mut Vector<i32>,
level_weights: &mut Vector<f64>,
) -> Result<()>
fn detect_multi_scale3_def( &mut self, image: &impl ToInputArray, objects: &mut Vector<Rect>, reject_levels: &mut Vector<i32>, level_weights: &mut Vector<f64>, ) -> Result<()>
@overload
This function allows you to retrieve the final stage decision certainty of classification.
For this, one needs to set
outputRejectLevels
on true and provide the rejectLevels
and levelWeights
parameter.
For each resulting detection, levelWeights
will then contain the certainty of classification at the final stage.
This value can then be used to separate strong from weaker classifications. Read morefn get_old_cascade(&mut self) -> Result<*mut c_void>
fn set_mask_generator( &mut self, mask_generator: &Ptr<BaseCascadeClassifier_MaskGenerator>, ) -> Result<()>
fn get_mask_generator( &mut self, ) -> Result<Ptr<BaseCascadeClassifier_MaskGenerator>>
Source§impl CascadeClassifierTraitConst for CascadeClassifier
impl CascadeClassifierTraitConst for CascadeClassifier
fn as_raw_CascadeClassifier(&self) -> *const c_void
fn is_old_format_cascade(&self) -> Result<bool>
fn get_original_window_size(&self) -> Result<Size>
fn get_feature_type(&self) -> Result<i32>
Source§impl Debug for CascadeClassifier
impl Debug for CascadeClassifier
Source§impl Drop for CascadeClassifier
impl Drop for CascadeClassifier
impl Send for CascadeClassifier
Auto Trait Implementations§
impl Freeze for CascadeClassifier
impl RefUnwindSafe for CascadeClassifier
impl !Sync for CascadeClassifier
impl Unpin for CascadeClassifier
impl UnwindSafe for CascadeClassifier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
Source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res,
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res, ) -> Res
Helper function to call OpenCV functions that allow in-place modification of a
Mat
or another similar object. By passing
a mutable reference to the Mat
to this function your closure will get called with the read reference and a write references
to the same Mat
. This is unsafe in a general case as it leads to having non-exclusive mutable access to the internal data,
but it can be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place
modification is imgproc::threshold
. Read more