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

source

pub fn default() -> Result<KalmanFilter>

source

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
source

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

source§

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

Return the underlying raw pointer while consuming this wrapper. Read more
source§

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

Return the underlying mutable raw pointer Read more
source§

impl Debug for KalmanFilter

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for KalmanFilter

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl KalmanFilterTrait for KalmanFilter

source§

fn as_raw_mut_KalmanFilter(&mut self) -> *mut c_void

source§

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)

corrected state (x(k)): x(k)=x’(k)+K(k)(z(k)-Hx’(k))
source§

fn set_transition_matrix(&mut self, val: Mat)

state transition matrix (A)
source§

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)

measurement matrix (H)
source§

fn set_process_noise_cov(&mut self, val: Mat)

process noise covariance matrix (Q)
source§

fn set_measurement_noise_cov(&mut self, val: Mat)

measurement noise covariance matrix (R)
source§

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_gain(&mut self, val: Mat)

Kalman gain matrix (K(k)): K(k)=P’(k)Htinv(H*P’(k)*Ht+R)
source§

fn set_error_cov_post(&mut self, val: Mat)

posteriori error estimate covariance matrix (P(k)): P(k)=(I-K(k)*H)*P’(k)
source§

fn set_temp1(&mut self, val: Mat)

source§

fn set_temp2(&mut self, val: Mat)

source§

fn set_temp3(&mut self, val: Mat)

source§

fn set_temp4(&mut self, val: Mat)

source§

fn set_temp5(&mut self, val: Mat)

source§

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<()>

Re-initializes Kalman filter. The previous content is destroyed. Read more
source§

fn predict(&mut self, control: &impl MatTraitConst) -> Result<Mat>

Computes a predicted state. Read more
source§

fn predict_def(&mut self) -> Result<Mat>

Computes a predicted state. Read more
source§

fn correct(&mut self, measurement: &impl MatTraitConst) -> Result<Mat>

Updates the predicted state from the measurement. Read more
source§

impl KalmanFilterTraitConst for KalmanFilter

source§

fn as_raw_KalmanFilter(&self) -> *const c_void

source§

fn state_pre(&self) -> Mat

predicted state (x’(k)): x(k)=Ax(k-1)+Bu(k)
source§

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

state transition matrix (A)
source§

fn control_matrix(&self) -> Mat

control matrix (B) (not used if there is no control)
source§

fn measurement_matrix(&self) -> Mat

measurement matrix (H)
source§

fn process_noise_cov(&self) -> Mat

process noise covariance matrix (Q)
source§

fn measurement_noise_cov(&self) -> Mat

measurement noise covariance matrix (R)
source§

fn error_cov_pre(&self) -> Mat

priori error estimate covariance matrix (P’(k)): P’(k)=A*P(k-1)*At + Q)
source§

fn gain(&self) -> Mat

Kalman gain matrix (K(k)): K(k)=P’(k)Htinv(H*P’(k)*Ht+R)
source§

fn error_cov_post(&self) -> Mat

posteriori error estimate covariance matrix (P(k)): P(k)=(I-K(k)*H)*P’(k)
source§

fn temp1(&self) -> Mat

source§

fn temp2(&self) -> Mat

source§

fn temp3(&self) -> Mat

source§

fn temp4(&self) -> Mat

source§

fn temp5(&self) -> Mat

source§

impl Send for KalmanFilter

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<Mat> ModifyInplace for Mat
where Mat: Boxed,

source§

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
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.