pub trait BackgroundSubtractorTrait: AlgorithmTrait + BackgroundSubtractorTraitConst {
// Required method
fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void;
// Provided methods
fn apply(
&mut self,
image: &impl ToInputArray,
fgmask: &mut impl ToOutputArray,
learning_rate: f64,
) -> Result<()> { ... }
fn apply_def(
&mut self,
image: &impl ToInputArray,
fgmask: &mut impl ToOutputArray,
) -> Result<()> { ... }
}
Expand description
Mutable methods for crate::video::BackgroundSubtractor
Required Methods§
fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void
Provided Methods§
Sourcefn apply(
&mut self,
image: &impl ToInputArray,
fgmask: &mut impl ToOutputArray,
learning_rate: f64,
) -> Result<()>
fn apply( &mut self, image: &impl ToInputArray, fgmask: &mut impl ToOutputArray, learning_rate: f64, ) -> Result<()>
Computes a foreground mask.
§Parameters
- image: Next video frame.
- fgmask: The output foreground mask as an 8-bit binary image.
- learningRate: The value between 0 and 1 that indicates how fast the background model is learnt. Negative parameter value makes the algorithm to use some automatically chosen learning rate. 0 means that the background model is not updated at all, 1 means that the background model is completely reinitialized from the last frame.
§C++ default parameters
- learning_rate: -1
Sourcefn apply_def(
&mut self,
image: &impl ToInputArray,
fgmask: &mut impl ToOutputArray,
) -> Result<()>
fn apply_def( &mut self, image: &impl ToInputArray, fgmask: &mut impl ToOutputArray, ) -> Result<()>
Computes a foreground mask.
§Parameters
- image: Next video frame.
- fgmask: The output foreground mask as an 8-bit binary image.
- learningRate: The value between 0 and 1 that indicates how fast the background model is learnt. Negative parameter value makes the algorithm to use some automatically chosen learning rate. 0 means that the background model is not updated at all, 1 means that the background model is completely reinitialized from the last frame.
§Note
This alternative version of BackgroundSubtractorTrait::apply function uses the following default values for its arguments:
- learning_rate: -1
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.