LiveFit
Track and plot projectiles for in-class demonstration
Public Member Functions | Protected Attributes | List of all members
TrackingFilter Class Reference

A wrapper around a KalmanFilter type object; additional logic can be provided through extension. More...

#include <TrackingFilter.hpp>

Inheritance diagram for TrackingFilter:
Inheritance graph
[legend]
Collaboration diagram for TrackingFilter:
Collaboration graph
[legend]

Public Member Functions

void flushKalman ()
 Reset KF state to initial values.
 
double kalmanDistance (cv::Mat measurement)
 Compute the Kalman distance to a measurement vector. More...
 
void updateTrackFailure ()
 Alert the KF that we did not track a ball this frame.
 
cv::Mat prediction ()
 The KF prediction of the state.
 
cv::Mat covariance ()
 The KF's covariance matrix.
 
void updateTimeState (double t)
 Update the time state of the tracker to the current time.
 
double dT ()
 Change in time from prior state to this one.
 
double time ()
 The current time state.
 
bool isFound ()
 Whether we have found a object recently.
 
bool isLost ()
 Whether the object is lost and we don't know anything about it.
 

Protected Attributes

int mBlobRad
 Radius of the current state blob?
 
int mLatency
 Unused?
 
int mNotFoundCount
 Number of frames we have missed this object for. More...
 
int mKfStateLen
 Length of the state vector; 6 <x,y,dx,dy,w,h>
 
cv::Mat mKfState
 State vector of most recent state.
 
int mFoundCount
 Number of frames we have tracked this object for.
 
int mKfControlLen
 
cv::Mat mKfControl
 
cv::Mat mKfControlVec
 
int mKfMeasLen
 Length of the measurement vector; 4 <x,y,w,h>
 
cv::Mat mKfMeas
 Measurement vector of most recent state.
 
double mTstart = 0
 Start time of this tick (the previous timestep's time)
 
double mTstop = 0
 Stop time of this tick (the current timestate)
 
KalmanFilterPlus mKf
 The Kalman Filter object proper.
 

Detailed Description

A wrapper around a KalmanFilter type object; additional logic can be provided through extension.

The idea is this is an "abstract" tracker which is object-agnostic; children should implement some methods with additional knowledge of the type of thing that they are trying to track.

Member Function Documentation

double TrackingFilter::kalmanDistance ( cv::Mat  measurement)

Compute the Kalman distance to a measurement vector.

The players...

  • z = input measurement vector
  • x = KF state pre
  • H = KF measurement matrix
  • P = KF error covariance matrix pre
  • R = KF measurement noise covariance

With,

\[\Sigma = HPH^T + R\]

Kalman Distance is defined as:

\[(z - Hx)^T * \Sigma^{-1} * (z - Hx) + \ln \det(\Sigma)\]

Additional information at http://www.mathworks.com/help/vision/ref/vision.kalmanfilter-class.html

Member Data Documentation

int TrackingFilter::mNotFoundCount
protected

Number of frames we have missed this object for.

If this number gets too large, we have lost the object


The documentation for this class was generated from the following files: