use std::os::raw::{c_char, c_void};
use libc::{ptrdiff_t, size_t};
use crate::{Error, Result, core, sys, types};
use crate::core::{_InputArray, _OutputArray};
pub fn create_background_subtractor_gmg(initialization_frames: i32, decision_threshold: f64) -> Result<types::PtrOfBackgroundSubtractorGMG> {
unsafe { sys::cv_bgsegm_createBackgroundSubtractorGMG_int_double(initialization_frames, decision_threshold) }.into_result().map(|ptr| types::PtrOfBackgroundSubtractorGMG { ptr })
}
pub fn create_background_subtractor_mog(history: i32, nmixtures: i32, background_ratio: f64, noise_sigma: f64) -> Result<types::PtrOfBackgroundSubtractorMOG> {
unsafe { sys::cv_bgsegm_createBackgroundSubtractorMOG_int_int_double_double(history, nmixtures, background_ratio, noise_sigma) }.into_result().map(|ptr| types::PtrOfBackgroundSubtractorMOG { ptr })
}
pub trait BackgroundSubtractorGMG {
#[inline(always)] fn as_raw_BackgroundSubtractorGMG(&self) -> *mut c_void;
fn get_max_features(&self) -> Result<i32> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorGMG_getMaxFeatures_const(self.as_raw_BackgroundSubtractorGMG()) }.into_result()
}
fn set_max_features(&mut self, max_features: i32) -> Result<()> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorGMG_setMaxFeatures_int(self.as_raw_BackgroundSubtractorGMG(), max_features) }.into_result()
}
fn get_default_learning_rate(&self) -> Result<f64> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorGMG_getDefaultLearningRate_const(self.as_raw_BackgroundSubtractorGMG()) }.into_result()
}
fn set_default_learning_rate(&mut self, lr: f64) -> Result<()> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorGMG_setDefaultLearningRate_double(self.as_raw_BackgroundSubtractorGMG(), lr) }.into_result()
}
fn get_num_frames(&self) -> Result<i32> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorGMG_getNumFrames_const(self.as_raw_BackgroundSubtractorGMG()) }.into_result()
}
fn set_num_frames(&mut self, nframes: i32) -> Result<()> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorGMG_setNumFrames_int(self.as_raw_BackgroundSubtractorGMG(), nframes) }.into_result()
}
fn get_quantization_levels(&self) -> Result<i32> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorGMG_getQuantizationLevels_const(self.as_raw_BackgroundSubtractorGMG()) }.into_result()
}
fn set_quantization_levels(&mut self, nlevels: i32) -> Result<()> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorGMG_setQuantizationLevels_int(self.as_raw_BackgroundSubtractorGMG(), nlevels) }.into_result()
}
fn get_background_prior(&self) -> Result<f64> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorGMG_getBackgroundPrior_const(self.as_raw_BackgroundSubtractorGMG()) }.into_result()
}
fn set_background_prior(&mut self, bgprior: f64) -> Result<()> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorGMG_setBackgroundPrior_double(self.as_raw_BackgroundSubtractorGMG(), bgprior) }.into_result()
}
fn get_smoothing_radius(&self) -> Result<i32> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorGMG_getSmoothingRadius_const(self.as_raw_BackgroundSubtractorGMG()) }.into_result()
}
fn set_smoothing_radius(&mut self, radius: i32) -> Result<()> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorGMG_setSmoothingRadius_int(self.as_raw_BackgroundSubtractorGMG(), radius) }.into_result()
}
fn get_decision_threshold(&self) -> Result<f64> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorGMG_getDecisionThreshold_const(self.as_raw_BackgroundSubtractorGMG()) }.into_result()
}
fn set_decision_threshold(&mut self, thresh: f64) -> Result<()> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorGMG_setDecisionThreshold_double(self.as_raw_BackgroundSubtractorGMG(), thresh) }.into_result()
}
fn get_update_background_model(&self) -> Result<bool> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorGMG_getUpdateBackgroundModel_const(self.as_raw_BackgroundSubtractorGMG()) }.into_result()
}
fn set_update_background_model(&mut self, update: bool) -> Result<()> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorGMG_setUpdateBackgroundModel_bool(self.as_raw_BackgroundSubtractorGMG(), update) }.into_result()
}
fn get_min_val(&self) -> Result<f64> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorGMG_getMinVal_const(self.as_raw_BackgroundSubtractorGMG()) }.into_result()
}
fn set_min_val(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorGMG_setMinVal_double(self.as_raw_BackgroundSubtractorGMG(), val) }.into_result()
}
fn get_max_val(&self) -> Result<f64> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorGMG_getMaxVal_const(self.as_raw_BackgroundSubtractorGMG()) }.into_result()
}
fn set_max_val(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorGMG_setMaxVal_double(self.as_raw_BackgroundSubtractorGMG(), val) }.into_result()
}
}
pub trait BackgroundSubtractorMOG {
#[inline(always)] fn as_raw_BackgroundSubtractorMOG(&self) -> *mut c_void;
fn get_history(&self) -> Result<i32> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorMOG_getHistory_const(self.as_raw_BackgroundSubtractorMOG()) }.into_result()
}
fn set_history(&mut self, nframes: i32) -> Result<()> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorMOG_setHistory_int(self.as_raw_BackgroundSubtractorMOG(), nframes) }.into_result()
}
fn get_n_mixtures(&self) -> Result<i32> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorMOG_getNMixtures_const(self.as_raw_BackgroundSubtractorMOG()) }.into_result()
}
fn set_n_mixtures(&mut self, nmix: i32) -> Result<()> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorMOG_setNMixtures_int(self.as_raw_BackgroundSubtractorMOG(), nmix) }.into_result()
}
fn get_background_ratio(&self) -> Result<f64> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorMOG_getBackgroundRatio_const(self.as_raw_BackgroundSubtractorMOG()) }.into_result()
}
fn set_background_ratio(&mut self, background_ratio: f64) -> Result<()> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorMOG_setBackgroundRatio_double(self.as_raw_BackgroundSubtractorMOG(), background_ratio) }.into_result()
}
fn get_noise_sigma(&self) -> Result<f64> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorMOG_getNoiseSigma_const(self.as_raw_BackgroundSubtractorMOG()) }.into_result()
}
fn set_noise_sigma(&mut self, noise_sigma: f64) -> Result<()> {
unsafe { sys::cv_bgsegm_BackgroundSubtractorMOG_setNoiseSigma_double(self.as_raw_BackgroundSubtractorMOG(), noise_sigma) }.into_result()
}
}