5

If this question is posted on the wrong stackexchange site - please suggest where I can migrate it to!

I'm studying the velocity of an object that undergoes multiple conditions with walls as well as with other objects. The raw data of the position of the object is slightly noisy, for two reasons: firstly, the resolution of the video is limited, and secondly, my tracking software also has some error in tracking the object (as the image of the object changes slightly over time).

If the velocity of the object is calculated simply by using the raw data of the position of the object, there is significant error (more than that of the velocity) as the object is being tracked at a high frame rate.

I am most interested in the velocity of the object during the time right before and after collisions, and this is thus a significant problem.

Possible options I've considered / attempted.

  • Applying a discrete Kalman Filter on the position data: This is a solution that comes out pretty often in posts about relate question. However, given that we have all the data when we begin to smooth our data, is the Kalman Filter the best way to make use of the available data? My understanding is that the filter is designed for data that is coming in over time (e.g. position data that is being received in real-time rather than a full set of position data).
  • Applying Savitsky-Golay smoothing on the position data: When I tried this on my data, I found that significant artifacts were introduced in the area of ±10 data points after each collision. I suspect this has something to do with the significant acceleration at collision, but after trying a range of parameters for the SG smoothing, I am unable to eliminate the artifacts.
  • Separating the data at collision, then smoothing velocities using a moving average: To overcome the problem introduced by the acceleration at each collision, I separated the data into multiple series at each collision point. For example, if there were three collisions, the data would be separated into four series. The velocity for each data series was then calculated and smoothed using a moving average.

In addition, some of my colleagues suggested passing the velocity information through a low-pass filter, which I have not attempted.

The two questions below are related to mine, and are provided as a reference.

Smooth of series data

Smooth GPS data

In addition, the paper below also seems to provide a good suggestion of how to implement the Kalman Filter, albeit for real-time data.

http://transportation.ce.gatech.edu/sites/default/files/files/smoothing_methods_designed_to_minimize_the_impact_of_gps_random_error_on_travel_distance_speed_and_acceleration_profile_estimates-trr.pdf

Community
  • 1
  • 1
Vincent Tjeng
  • 693
  • 8
  • 25

1 Answers1

3

Choosing an appropriate filtering algorithm depends mainly on the behavior of your object and your measurement errors (or noise). So I can only give some generic tips:

Differentiation, i.e., calculating the velocity from position data amplifies noise considerably. So probably you do need some kind of smoothing. My ad-hoc approach would be: Fourier-Transform your position data, do the derivative in Fourier space and play around to find an appropriate boundaries for low-path filtering. Applying other transfer functions to your transformed positioned data can be interpreted as kernel smoothing (though some mathematical insight in kernel methods is needed to do that properly).

The Kalman filter is state estimator, which works recursively. If you have a proper (discrete time) motion model & measurement model, it will yield in good results and give you a direct estimate for the velocity. The rules of thumb for such an approach:

  • Model in the 3D space or 6D space if your object has rotational degrees of freedom, not in image space (the noise behaves differently)
  • Carefully investigate your projection errors (camera calibration) & carefully choose the noise parameters
  • Use an Unscented Kalman filter (it is much better than an Extended Kalman filter) if non-linearities occur

Kalman filtering and low path filtering are closely related. For many simple applications the Kalman Filter can be thought of an adaptive low path filter, which does smoothing.

The non-recursive Kalman Filter is a called Gaussian process - though I only see advantages over the Kalman filter if your trajectories have a small number data points. Their application is not as straight forward as the KF.

Dietrich
  • 5,241
  • 3
  • 24
  • 36
  • Hi @Dietrich, what kind of motion and measurement models will I require? I have a rough idea of how my object will travel based on the law of kinematics. – Vincent Tjeng Feb 05 '13 at 12:31
  • For the Kalman filter you need a linear discrete-time state space model of your kinematics. Very simple kinematic models will result in similar behavior of a normal low path filter. – Dietrich Feb 05 '13 at 12:55
  • so, would it be correct to say that the closer my model approaches the reality, the more accurate the filter will be? – Vincent Tjeng Feb 05 '13 at 14:43
  • are you ok to discuss a bit of physics here? let's say that I have a kinematics model which predicts that the motion depends on gravity $g=9.8 ms^{-2}$. If I wrongly estimate that it is equal to half of that (i.e. 4.9), will the model be very mistaken? thanks :) – Vincent Tjeng Feb 05 '13 at 14:44
  • Well, the dynamics are of interest. See https://en.wikipedia.org/wiki/State_space_representation#Moving_object_example for an example. How to obtain a discrete time model, check https://en.wikipedia.org/wiki/Discretization – Dietrich Feb 05 '13 at 16:22