Kalman filter in computer vision: choice of covariances Q and R

I read some works on Kalman filters for tracking CV objects, but I canโ€™t find a link to choose: 1) the covariance of Q noise processes; 2) The covariance of the measurement noise R. So far, I realized that the model is an equation of motion (someone uses acceleration as a state variable, others use only position and speed), but no one knows about the choice of Q and R, including this example using mathworks: http://www.mathworks.it/it/help/vision/examples/using-kalman-filter-for-object-tracking.html I recently found this page: http: //blog.cordiner. net / 2011/05/03 / object-tracking-using-a-kalman-filter-matlab / but the purpose of Q and R is not clear. Does anyone know help me please?

+5
source share
1 answer

R is the covariance matrix of the measuring noise, assumed to be Gaussian. In the context of tracking objects in a video, this means your detection error. Let's say you use a face detector to detect faces, and then you want to track them using the Kalman filter. You start the detector, you get a bounding box for each face, and then you use the Kalman filter to track the centroid of each window. The R-matrix should describe how uncertain you are about the location of the center of gravity. Therefore, in this case, for the x, y coordinates, the corresponding diagonal values โ€‹โ€‹of R should be several pixels. If your condition includes speed, then you need to guess the uncertainty of speed measurement and consider units. If your position is measured in pixels and your speed in pixels per frame, then the diagonal entries R should reflect this.

Q is the covariance of the process noise. Simply put, Q indicates how much the actual movement of the object deviates from your intended motion model. If you track cars on the road, then a constant speed model should be good enough, and Q records should be small. If you track people's faces, they are unlikely to move at a constant speed, so you need to scroll Q. Again, you need to know the units in which your state variables are expressed.

So this is intuition. In practice, you start with a reasonable initial assumption for R and Q, and then set them up experimentally. So installing R and Q is a bit of art. In addition, in most cases, the use of diagonal matrices for R and Q is sufficient.

Here is an example that uses vision.KalmanFilter in Matalb to track multiple people.

+4
source

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


All Articles