Position and tracking speed using Kalman filter

I use the Kalman filter (constant speed model) to track the position and speed of an object. I measure x, y of an object and tracks x, y, vx, vy. Which works, but if adding a Gaussian noise of + - 20 mm to the sensor readings x, y, vx, vy fluctuates, even if the point does not move only by noise. For a location that is good enough for my needs, but the speed changes when the point is stationary and that causes problems with calculating the speed of the object. Is there any way around this problem? also, if switching to a constant acceleration model improves? I track the robot through the camera.

I use opencv implementation and my kalman model is the same as [1]

[1] http://www.morethantechnical.com/2011/06/17/simple-kalman-filter-for-tracking-using-opencv-2-2-w-code/

+5
source share
1 answer

The most important thing in developing a Kalman filter is not data, it's error estimates. The matrices in this example seem to be randomly selected, but you must select them using specific knowledge of your system. In particular:

  • Error covariance has units. This is the standard deviation squared. So your position error is in the "squared length" and speed in the "squared time". The values ​​in these matrices will differ depending on whether you work in m or mm.
  • You implement the "constant speed" model, but the "processNoiseCov" from the example sets the same values ​​for both process noise and speed. This means that you can be wrong in your position due to the incorrectness of your speed, and you can be wrong because the object is teleported in a way that is independent of speed. In the CV model, you expect the noise of the position process to be very low (mostly non-zero only for numerical reasons and the coverage of the modeling error), and the true unknown system motion will be associated with an unknown speed. This problem also impedes KF’s ability to get speed out of position because the “teleportation error” is not related to speed changes.
  • If you put +/- 20 mm errors (you really have to introduce Gaussian noise if you want to simulate perfect behavior), you have an approximate standard deviation of 11.5 mm or variance (11.5 mm) ^ 2, Not knowing what your units are (mm or m), I cannot say what should be the numerical value of "measureNoiseCov", but it is not 0.1 (as in the example).

And finally, even so, everything is correct, remember that KF is ultimately a linear filter. No matter what noise you enter, it will be displayed at the output, it is simply scaled by some coefficient (Kalman gain).

+2
source

Source: https://habr.com/ru/post/1238272/


All Articles