Please explain what is the use of kalman filter in

2020-07-28 11:49发布

问题:

A guy posted this tutorial about object tracking using Kalman filter. Many people rated high star so it is not a fault/wrong tutorial.

However, a guys posted the following question:" In this code you have done detection in every frame and this output is provided as the input to the kalman filter.So background subtraction and kalman filter will give similar results.So please can you explain the use of kalman filter here. "

I have the same thought with him. Can anybody explain the use of Kalman filter here?

回答1:

A simple detection with background subtraction will give a result in every sample period, however the result will be noisy (due to measurement noise and perhaps quantization) and detection errors will have a huge impact.

If you want to observe an object you usually know something about how it will move. It won't jump from one position to the next but move there in a continuous way. The Kalman filter combines the measurements from the simple detection algorithm and combines them with the model knowledge that you have about the object (position can't jump), so it filters the measurement and considers the history of the measurements. Considering a linear system, you can prove that the Kalman filter is the optimal way of filtering the data considering the measurement noise of the system.

Edit: In this tutorial, the Kalman filter is obviously used to predict the position of the ball in the next step. In the downwards motion, this works pretty well. As the filter doesn't know anything about the floor, the prediction is of course wrong when the ball hits the ground. During the upwards motion, the prediction still suffers from this error.



回答2:

An intutitive overview of the kalman works on the principle of least means square. It computes 2 parameter which is related to the kalman gain. You can think of it this way - there are 2 parameters, 1 for observed, the other for prediction, ie. the 2 parameters will give more weight to trust the observed data, and less for the prediction data, or vice versa, to adapt on the next round if the 'guess' is correct. If not, the error will influence the gains to adjust accordingly. Thus, kalman filter, like wiener, is termed 'adaptive'.