Struct opencv::video::KalmanFilter
source · pub struct KalmanFilter { /* private fields */ }
Expand description
Kalman filter class.
The class implements a standard Kalman filter http://en.wikipedia.org/wiki/Kalman_filter, Welch95 . However, you can modify transitionMatrix, controlMatrix, and measurementMatrix to get an extended Kalman filter functionality.
Note: In C API when CvKalman* kalmanFilter structure is not needed anymore, it should be released with cvReleaseKalman(&kalmanFilter)
Implementations§
source§impl KalmanFilter
impl KalmanFilter
pub fn default() -> Result<KalmanFilter>
sourcepub fn new(
dynam_params: i32,
measure_params: i32,
control_params: i32,
typ: i32
) -> Result<KalmanFilter>
pub fn new( dynam_params: i32, measure_params: i32, control_params: i32, typ: i32 ) -> Result<KalmanFilter>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
§Parameters
- dynamParams: Dimensionality of the state.
- measureParams: Dimensionality of the measurement.
- controlParams: Dimensionality of the control vector.
- type: Type of the created matrices that should be CV_32F or CV_64F.
§C++ default parameters
- control_params: 0
- typ: CV_32F
sourcepub fn new_def(dynam_params: i32, measure_params: i32) -> Result<KalmanFilter>
pub fn new_def(dynam_params: i32, measure_params: i32) -> Result<KalmanFilter>
@overload
§Parameters
- dynamParams: Dimensionality of the state.
- measureParams: Dimensionality of the measurement.
- controlParams: Dimensionality of the control vector.
- type: Type of the created matrices that should be CV_32F or CV_64F.
§Note
This alternative version of [new] function uses the following default values for its arguments:
- control_params: 0
- typ: CV_32F
Trait Implementations§
source§impl Boxed for KalmanFilter
impl Boxed for KalmanFilter
source§unsafe fn from_raw(
ptr: <KalmanFilter as OpenCVFromExtern>::ExternReceive
) -> Self
unsafe fn from_raw( ptr: <KalmanFilter as OpenCVFromExtern>::ExternReceive ) -> Self
Wrap the specified raw pointer Read more
source§fn into_raw(self) -> <KalmanFilter as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw(self) -> <KalmanFilter as OpenCVTypeExternContainer>::ExternSendMut
Return the underlying raw pointer while consuming this wrapper. Read more
source§fn as_raw(&self) -> <KalmanFilter as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <KalmanFilter as OpenCVTypeExternContainer>::ExternSend
Return the underlying raw pointer. Read more
source§fn as_raw_mut(
&mut self
) -> <KalmanFilter as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut( &mut self ) -> <KalmanFilter as OpenCVTypeExternContainer>::ExternSendMut
Return the underlying mutable raw pointer Read more
source§impl Debug for KalmanFilter
impl Debug for KalmanFilter
source§impl Drop for KalmanFilter
impl Drop for KalmanFilter
source§impl KalmanFilterTrait for KalmanFilter
impl KalmanFilterTrait for KalmanFilter
fn as_raw_mut_KalmanFilter(&mut self) -> *mut c_void
source§fn set_state_pre(&mut self, val: Mat)
fn set_state_pre(&mut self, val: Mat)
predicted state (x’(k)): x(k)=Ax(k-1)+Bu(k)
source§fn set_state_post(&mut self, val: Mat)
fn set_state_post(&mut self, val: Mat)
corrected state (x(k)): x(k)=x’(k)+K(k)(z(k)-Hx’(k))
source§fn set_transition_matrix(&mut self, val: Mat)
fn set_transition_matrix(&mut self, val: Mat)
state transition matrix (A)
source§fn set_control_matrix(&mut self, val: Mat)
fn set_control_matrix(&mut self, val: Mat)
control matrix (B) (not used if there is no control)
source§fn set_measurement_matrix(&mut self, val: Mat)
fn set_measurement_matrix(&mut self, val: Mat)
measurement matrix (H)
source§fn set_process_noise_cov(&mut self, val: Mat)
fn set_process_noise_cov(&mut self, val: Mat)
process noise covariance matrix (Q)
source§fn set_measurement_noise_cov(&mut self, val: Mat)
fn set_measurement_noise_cov(&mut self, val: Mat)
measurement noise covariance matrix (R)
source§fn set_error_cov_pre(&mut self, val: Mat)
fn set_error_cov_pre(&mut self, val: Mat)
priori error estimate covariance matrix (P’(k)): P’(k)=A*P(k-1)*At + Q)
source§fn set_error_cov_post(&mut self, val: Mat)
fn set_error_cov_post(&mut self, val: Mat)
posteriori error estimate covariance matrix (P(k)): P(k)=(I-K(k)*H)*P’(k)
fn set_temp1(&mut self, val: Mat)
fn set_temp2(&mut self, val: Mat)
fn set_temp3(&mut self, val: Mat)
fn set_temp4(&mut self, val: Mat)
fn set_temp5(&mut self, val: Mat)
source§fn init(
&mut self,
dynam_params: i32,
measure_params: i32,
control_params: i32,
typ: i32
) -> Result<()>
fn init( &mut self, dynam_params: i32, measure_params: i32, control_params: i32, typ: i32 ) -> Result<()>
Re-initializes Kalman filter. The previous content is destroyed. Read more
source§fn init_def(&mut self, dynam_params: i32, measure_params: i32) -> Result<()>
fn init_def(&mut self, dynam_params: i32, measure_params: i32) -> Result<()>
Re-initializes Kalman filter. The previous content is destroyed. Read more
source§impl KalmanFilterTraitConst for KalmanFilter
impl KalmanFilterTraitConst for KalmanFilter
fn as_raw_KalmanFilter(&self) -> *const c_void
source§fn state_post(&self) -> Mat
fn state_post(&self) -> Mat
corrected state (x(k)): x(k)=x’(k)+K(k)(z(k)-Hx’(k))
source§fn transition_matrix(&self) -> Mat
fn transition_matrix(&self) -> Mat
state transition matrix (A)
source§fn control_matrix(&self) -> Mat
fn control_matrix(&self) -> Mat
control matrix (B) (not used if there is no control)
source§fn measurement_matrix(&self) -> Mat
fn measurement_matrix(&self) -> Mat
measurement matrix (H)
source§fn process_noise_cov(&self) -> Mat
fn process_noise_cov(&self) -> Mat
process noise covariance matrix (Q)
source§fn measurement_noise_cov(&self) -> Mat
fn measurement_noise_cov(&self) -> Mat
measurement noise covariance matrix (R)
source§fn error_cov_pre(&self) -> Mat
fn error_cov_pre(&self) -> Mat
priori error estimate covariance matrix (P’(k)): P’(k)=A*P(k-1)*At + Q)
source§fn error_cov_post(&self) -> Mat
fn error_cov_post(&self) -> Mat
posteriori error estimate covariance matrix (P(k)): P(k)=(I-K(k)*H)*P’(k)
fn temp1(&self) -> Mat
fn temp2(&self) -> Mat
fn temp3(&self) -> Mat
fn temp4(&self) -> Mat
fn temp5(&self) -> Mat
impl Send for KalmanFilter
Auto Trait Implementations§
impl Freeze for KalmanFilter
impl RefUnwindSafe for KalmanFilter
impl !Sync for KalmanFilter
impl Unpin for KalmanFilter
impl UnwindSafe for KalmanFilter
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res ) -> Res
Helper function to call OpenCV functions that allow in-place modification of a
Mat
or another similar object. By passing
a mutable reference to the Mat
to this function your closure will get called with the read reference and a write references
to the same Mat
. This is of course unsafe as it breaks the Rust aliasing rules, but it might be useful for some performance
sensitive operations. One example of an OpenCV function that allows such in-place modification is imgproc::threshold
. Read more