pub trait BackgroundSubtractorKNNTraitConst: BackgroundSubtractorTraitConst {
// Required method
fn as_raw_BackgroundSubtractorKNN(&self) -> *const c_void;
// Provided methods
fn get_history(&self) -> Result<i32> { ... }
fn get_n_samples(&self) -> Result<i32> { ... }
fn get_dist2_threshold(&self) -> Result<f64> { ... }
fn getk_nn_samples(&self) -> Result<i32> { ... }
fn get_detect_shadows(&self) -> Result<bool> { ... }
fn get_shadow_value(&self) -> Result<i32> { ... }
fn get_shadow_threshold(&self) -> Result<f64> { ... }
}
Expand description
Constant methods for crate::video::BackgroundSubtractorKNN
Required Methods§
fn as_raw_BackgroundSubtractorKNN(&self) -> *const c_void
Provided Methods§
Sourcefn get_history(&self) -> Result<i32>
fn get_history(&self) -> Result<i32>
Returns the number of last frames that affect the background model
Sourcefn get_n_samples(&self) -> Result<i32>
fn get_n_samples(&self) -> Result<i32>
Returns the number of data samples in the background model
Sourcefn get_dist2_threshold(&self) -> Result<f64>
fn get_dist2_threshold(&self) -> Result<f64>
Returns the threshold on the squared distance between the pixel and the sample
The threshold on the squared distance between the pixel and the sample to decide whether a pixel is close to a data sample.
Sourcefn getk_nn_samples(&self) -> Result<i32>
fn getk_nn_samples(&self) -> Result<i32>
Returns the number of neighbours, the k in the kNN.
K is the number of samples that need to be within dist2Threshold in order to decide that that pixel is matching the kNN background model.
Sourcefn get_detect_shadows(&self) -> Result<bool>
fn get_detect_shadows(&self) -> Result<bool>
Returns the shadow detection flag
If true, the algorithm detects shadows and marks them. See createBackgroundSubtractorKNN for details.
Sourcefn get_shadow_value(&self) -> Result<i32>
fn get_shadow_value(&self) -> Result<i32>
Returns the shadow value
Shadow value is the value used to mark shadows in the foreground mask. Default value is 127. Value 0 in the mask always means background, 255 means foreground.
Sourcefn get_shadow_threshold(&self) -> Result<f64>
fn get_shadow_threshold(&self) -> Result<f64>
Returns the shadow threshold
A shadow is detected if pixel is a darker version of the background. The shadow threshold (Tau in the paper) is a threshold defining how much darker the shadow can be. Tau= 0.5 means that if a pixel is more than twice darker then it is not shadow. See Prati, Mikic, Trivedi and Cucchiara, Detecting Moving Shadows…, IEEE PAMI,2003.
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.