pub trait BackgroundSubtractorGMGTrait: BackgroundSubtractorGMGTraitConst + BackgroundSubtractorTrait {
Show 13 methods
// Required method
fn as_raw_mut_BackgroundSubtractorGMG(&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<()> { ... }
fn set_max_features(&mut self, max_features: i32) -> Result<()> { ... }
fn set_default_learning_rate(&mut self, lr: f64) -> Result<()> { ... }
fn set_num_frames(&mut self, nframes: i32) -> Result<()> { ... }
fn set_quantization_levels(&mut self, nlevels: i32) -> Result<()> { ... }
fn set_background_prior(&mut self, bgprior: f64) -> Result<()> { ... }
fn set_smoothing_radius(&mut self, radius: i32) -> Result<()> { ... }
fn set_decision_threshold(&mut self, thresh: f64) -> Result<()> { ... }
fn set_update_background_model(&mut self, update: bool) -> Result<()> { ... }
fn set_min_val(&mut self, val: f64) -> Result<()> { ... }
fn set_max_val(&mut self, val: f64) -> Result<()> { ... }
}
Expand description
Mutable methods for crate::bgsegm::BackgroundSubtractorGMG
Required Methods§
fn as_raw_mut_BackgroundSubtractorGMG(&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 of type CV_8UC(n),CV_8SC(n),CV_16UC(n),CV_16SC(n),CV_32SC(n),CV_32FC(n),CV_64FC(n), where n is 1,2,3,4.
- 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 of type CV_8UC(n),CV_8SC(n),CV_16UC(n),CV_16SC(n),CV_32SC(n),CV_32FC(n),CV_64FC(n), where n is 1,2,3,4.
- 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 BackgroundSubtractorGMGTrait::apply function uses the following default values for its arguments:
- learning_rate: -1
Sourcefn set_max_features(&mut self, max_features: i32) -> Result<()>
fn set_max_features(&mut self, max_features: i32) -> Result<()>
Sets total number of distinct colors to maintain in histogram.
Sourcefn set_default_learning_rate(&mut self, lr: f64) -> Result<()>
fn set_default_learning_rate(&mut self, lr: f64) -> Result<()>
Sets the learning rate of the algorithm.
Sourcefn set_num_frames(&mut self, nframes: i32) -> Result<()>
fn set_num_frames(&mut self, nframes: i32) -> Result<()>
Sets the number of frames used to initialize background model.
Sourcefn set_quantization_levels(&mut self, nlevels: i32) -> Result<()>
fn set_quantization_levels(&mut self, nlevels: i32) -> Result<()>
Sets the parameter used for quantization of color-space
Sourcefn set_background_prior(&mut self, bgprior: f64) -> Result<()>
fn set_background_prior(&mut self, bgprior: f64) -> Result<()>
Sets the prior probability that each individual pixel is a background pixel.
Sourcefn set_smoothing_radius(&mut self, radius: i32) -> Result<()>
fn set_smoothing_radius(&mut self, radius: i32) -> Result<()>
Sets the kernel radius used for morphological operations
Sourcefn set_decision_threshold(&mut self, thresh: f64) -> Result<()>
fn set_decision_threshold(&mut self, thresh: f64) -> Result<()>
Sets the value of decision threshold.
Sourcefn set_update_background_model(&mut self, update: bool) -> Result<()>
fn set_update_background_model(&mut self, update: bool) -> Result<()>
Sets the status of background model update
Sourcefn set_min_val(&mut self, val: f64) -> Result<()>
fn set_min_val(&mut self, val: f64) -> Result<()>
Sets the minimum value taken on by pixels in image sequence.
Sourcefn set_max_val(&mut self, val: f64) -> Result<()>
fn set_max_val(&mut self, val: f64) -> Result<()>
Sets the maximum value taken on by pixels in image sequence.
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.