F. Yu, W. Li, Q. Li, Y. Liu, X. Shi, J. Yan. POI: Multiple Object Tracking with High Performance Detection and Appearance Feature. In BMTT, SenseTime Group Limited, 2016.
github:https://github.com/nwojke/deep_sort
deep_sort代码处理流程解析
按视频帧顺序处理,每一帧的处理流程如下:
1.读取当前帧目标检测框的位置及各检测框图像块的深度特征(此处在处理实际使用时需要自己来提取);
2.根据置信度对检测框进行过滤,即对置信度不足够高的检测框及特征予以删除;
3.对检测框进行非最大值抑制,消除一个目标身上多个框的情况;
4.预测:使用kalman滤波预测目标在当前帧的位置
5.更新:更新kalman追踪器参数及特征集,另外进行目标消失、新目标出现的判断
4.预测
kalman滤波公式1和2:
x(k)=Ax(k−1)
p(k)=Ap(k−1)AT+Q,
其中,x(k−1) 为目标的状态信息(代码中的mean),为上一帧中目标的信息[center x,center y,aspect ration,height,0,0,0,0];p(k−1)为目标的估计误差(代码中的covariance);A为状态转移矩阵;Q为系统误差;
#mean
mean_pos = measurement
mean_vel = np.zeros_like(mean_pos)
mean = np.r_[mean_pos, mean_vel]
#covariance
self._std_weight_position = 1. / 20
self._std_weight_velocity = 1. / 160 (可调参数)
std = [
2 * self._std_weight_position * measurement[3],
2 * self._std_weight_position * measurement[3],
1e-2,
2 * self._std_weight_position * measurement[3],
10 * self._std_weight_velocity * measurement[3],
10 * self._std_weight_velocity * measurement[3],
1e-5,
10 * self._std_weight_velocity * measurement[3]]
covariance = np.diag(np.square(std