Trait opencv::prelude::BackgroundSubtractorMOG2
source · [−]pub trait BackgroundSubtractorMOG2: BackgroundSubtractor + BackgroundSubtractorMOG2Const {
Show 14 methods
fn as_raw_mut_BackgroundSubtractorMOG2(&mut self) -> *mut c_void;
fn set_history(&mut self, history: i32) -> Result<()> { ... }
fn set_n_mixtures(&mut self, nmixtures: i32) -> Result<()> { ... }
fn set_background_ratio(&mut self, ratio: f64) -> Result<()> { ... }
fn set_var_threshold(&mut self, var_threshold: f64) -> Result<()> { ... }
fn set_var_threshold_gen(&mut self, var_threshold_gen: f64) -> Result<()> { ... }
fn set_var_init(&mut self, var_init: f64) -> Result<()> { ... }
fn set_var_min(&mut self, var_min: f64) -> Result<()> { ... }
fn set_var_max(&mut self, var_max: f64) -> Result<()> { ... }
fn set_complexity_reduction_threshold(&mut self, ct: f64) -> Result<()> { ... }
fn set_detect_shadows(&mut self, detect_shadows: bool) -> Result<()> { ... }
fn set_shadow_value(&mut self, value: i32) -> Result<()> { ... }
fn set_shadow_threshold(&mut self, threshold: f64) -> Result<()> { ... }
fn apply(
&mut self,
image: &dyn ToInputArray,
fgmask: &mut dyn ToOutputArray,
learning_rate: f64
) -> Result<()> { ... }
}
Required Methods
fn as_raw_mut_BackgroundSubtractorMOG2(&mut self) -> *mut c_void
Provided Methods
sourcefn set_history(&mut self, history: i32) -> Result<()>
fn set_history(&mut self, history: i32) -> Result<()>
Sets the number of last frames that affect the background model
sourcefn set_n_mixtures(&mut self, nmixtures: i32) -> Result<()>
fn set_n_mixtures(&mut self, nmixtures: i32) -> Result<()>
Sets the number of gaussian components in the background model.
The model needs to be reinitalized to reserve memory.
sourcefn set_background_ratio(&mut self, ratio: f64) -> Result<()>
fn set_background_ratio(&mut self, ratio: f64) -> Result<()>
Sets the “background ratio” parameter of the algorithm
sourcefn set_var_threshold(&mut self, var_threshold: f64) -> Result<()>
fn set_var_threshold(&mut self, var_threshold: f64) -> Result<()>
Sets the variance threshold for the pixel-model match
sourcefn set_var_threshold_gen(&mut self, var_threshold_gen: f64) -> Result<()>
fn set_var_threshold_gen(&mut self, var_threshold_gen: f64) -> Result<()>
Sets the variance threshold for the pixel-model match used for new mixture component generation
sourcefn set_var_init(&mut self, var_init: f64) -> Result<()>
fn set_var_init(&mut self, var_init: f64) -> Result<()>
Sets the initial variance of each gaussian component
fn set_var_min(&mut self, var_min: f64) -> Result<()>
fn set_var_max(&mut self, var_max: f64) -> Result<()>
sourcefn set_complexity_reduction_threshold(&mut self, ct: f64) -> Result<()>
fn set_complexity_reduction_threshold(&mut self, ct: f64) -> Result<()>
Sets the complexity reduction threshold
sourcefn set_detect_shadows(&mut self, detect_shadows: bool) -> Result<()>
fn set_detect_shadows(&mut self, detect_shadows: bool) -> Result<()>
Enables or disables shadow detection
sourcefn set_shadow_value(&mut self, value: i32) -> Result<()>
fn set_shadow_value(&mut self, value: i32) -> Result<()>
Sets the shadow value
sourcefn set_shadow_threshold(&mut self, threshold: f64) -> Result<()>
fn set_shadow_threshold(&mut self, threshold: f64) -> Result<()>
Sets the shadow threshold
sourcefn apply(
&mut self,
image: &dyn ToInputArray,
fgmask: &mut dyn ToOutputArray,
learning_rate: f64
) -> Result<()>
fn apply(
&mut self,
image: &dyn ToInputArray,
fgmask: &mut dyn ToOutputArray,
learning_rate: f64
) -> Result<()>
Computes a foreground mask.
Parameters
- image: Next video frame. Floating point frame will be used without scaling and should be in range
.
- 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