[][src]Trait opencv::video::prelude::BackgroundSubtractor

pub trait BackgroundSubtractor: AlgorithmTrait {
    pub fn as_raw_BackgroundSubtractor(&self) -> *const c_void;
pub fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void; pub fn apply(
        &mut self,
        image: &dyn ToInputArray,
        fgmask: &mut dyn ToOutputArray,
        learning_rate: f64
    ) -> Result<()> { ... }
pub fn get_background_image(
        &self,
        background_image: &mut dyn ToOutputArray
    ) -> Result<()> { ... } }

Base class for background/foreground segmentation. :

The class is only used to define the common interface for the whole family of background/foreground segmentation algorithms.

Required methods

Loading content...

Provided methods

pub fn apply(
    &mut self,
    image: &dyn ToInputArray,
    fgmask: &mut dyn ToOutputArray,
    learning_rate: f64
) -> Result<()>
[src]

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

pub fn get_background_image(
    &self,
    background_image: &mut dyn ToOutputArray
) -> Result<()>
[src]

Computes a background image.

Parameters

  • backgroundImage: The output background image.

Note: Sometimes the background image can be very blurry, as it contain the average background statistics.

Loading content...

Implementors

impl BackgroundSubtractor for PtrOfBackgroundSubtractorCNT[src]

impl BackgroundSubtractor for PtrOfBackgroundSubtractorGMG[src]

impl BackgroundSubtractor for PtrOfBackgroundSubtractorGSOC[src]

impl BackgroundSubtractor for PtrOfBackgroundSubtractorKNN[src]

impl BackgroundSubtractor for PtrOfBackgroundSubtractorLSBP[src]

impl BackgroundSubtractor for PtrOfBackgroundSubtractorMOG2[src]

impl BackgroundSubtractor for PtrOfBackgroundSubtractorMOG[src]

impl BackgroundSubtractor for PtrOfCUDA_BackgroundSubtractorMOG2[src]

impl BackgroundSubtractor for PtrOfCUDA_BackgroundSubtractorMOG[src]

Loading content...