问题描述
我读了一些关于卡尔曼滤波器用于CV对象跟踪的作品,但是我找不到一些关于选择的参考:1)过程噪声协方差Q; 2)测量噪声协方差R.到目前为止,我已经认识到模型是运动方程(有人使用加速度作为状态变量,其他人只使用位置和速度),但没有人清楚Q和R选择,包括这个例子由mathworks: a href =http://www.mathworks.it/it/help/vision/examples/using-kalman-filter-for-object-tracking.html =nofollow> http://www.mathworks。最近我发现这个页面:
但是Q和R赋值不清楚。有人知道帮助我吗?
I read some works about Kalman filter for CV object tracking but I can't find some reference about the choice of: 1)the process noise covariance Q; 2)Measurement noise covariance R. So far I have realized that the model is equation of motion (someone uses acceleration as state variable, others use position and speed only) but nobody is clear about Q and R choice including this example by mathworks: http://www.mathworks.it/it/help/vision/examples/using-kalman-filter-for-object-tracking.htmlRecently I found this page:http://blog.cordiner.net/2011/05/03/object-tracking-using-a-kalman-filter-matlab/but the Q and R assignment is not clear. Does anyone know help me, please ?
推荐答案
R是测量噪声的协方差矩阵,假定为高斯分布。在跟踪视频中的对象的上下文中,这意味着您的检测错误。假设您正在使用面部检测器来检测面部,然后您想使用卡尔曼滤波器来跟踪它们。你运行检测器,你得到每个面部的边界框,然后使用卡尔曼滤波器来跟踪每个框的质心。 R矩阵必须描述关于质心位置的不确定性。因此在这种情况下对于x,y坐标,R的对应对角线值应该是几个像素。如果你的状态包括速度,你需要猜测速度测量的不确定性,并考虑单位。如果你的位置是以像素为单位测量的,你的速度以每帧的像素为单位,那么R的对角线条目必须反映这一点。
R is the covariance matrix of the measurement noise, assumed to be Gaussian. In the context of tracking objects in video it means your detection error. Let's say you are using a face detector to detect faces, and then you want to track them using the Kalman filter. You run the detector, you get a bounding box for each face, and then you use the Kalman filter to track the centroid of each box. The R matrix must describe how uncertain you are about the location of the centroid. So in this case for the x,y coordinates the corresponding diagonal values of R should be a few pixels. If your state includes velocity, then you need to guess the uncertainty of the velocity measurement, and take the units into account. If your position is measured in pixels and your velocity in pixels per frame, then the diagonal entries of R must reflect that.
Q是过程噪声的协方差。简单地说,Q指定对象的实际运动偏离你假设的运动模型有多少。如果你在路上跟踪汽车,那么恒定速度模型应该是相当好的,并且Q的条目应该小。如果你正在跟踪人的面部,他们不可能以恒定速度移动,所以你需要启动Q.再次,你需要知道你的状态变量表示的单位。
Q is the covariance of the process noise. Simply put, Q specify how much the actual motion of the object deviates from your assumed motion model. If you are tracking cars on a road, then the constant velocity model should be reasonably good, and the entries of Q should be small. If you are tracking people's faces, they are not likely to move with a constant velocity, so you need to crank up Q. Again, you need to be aware of the units in which your state variables are expressed.
所以这是直觉。在实践中,你从R和Q的一些合理的初始猜测开始,然后你通过实验调整它们。所以设置R和Q是一个艺术。此外,在大多数情况下,使用R和Q的对角矩阵就足够了。
So this is the intuition. In practice you start with some reasonable initial guess for R and Q, and then you tune them experimentally. So setting R and Q is a bit of an art. Also, in most cases using diagonal matrices for R and Q is sufficient.
以下是,它使用Matalb中的 vision.KalmanFilter
跟踪多个人。
Here is an example that uses the vision.KalmanFilter
in Matalb for tracking multiple people.
这篇关于卡尔曼滤波在计算机视觉:选择Q和R噪声协方差的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!