﻿ 基于三维坐标的运动目标跟踪
«上一篇
 文章快速检索 高级检索

 应用科技  2018, Vol. 45 Issue (2): 23-28  DOI: 10.11991/yykj.201612007 0

### 引用本文

CHEN Chunyu, YANG Qiuguang, LI Dongfang. Moving objective tracking based on 3D coordinates[J]. Applied Science and Technology, 2018, 45(2), 23-28. DOI: 10.11991/yykj.201612007.

### 文章历史

Moving objective tracking based on 3D coordinates
CHEN Chunyu, YANG Qiuguang, LI Dongfang
College of Information and Communication Engineering, Harbin Engineering University, Harbin 150001, China
Abstract: As for multi-objective tracking based on two-dimensional coordinates, because of mutual objective obstruction, the algorithm is hard to distinguish from moving objectives and the objective tracking may fail; while three-dimensional coordinates have depth information, the moving objectives can be clearly identified due to the non-mutation of coordinates before and after objective obstruction, therefore, the paper proposed a new multi-objective tracking algorithm based on three-dimensional coordinates. Firstly, the background subtraction method is used to detect objectives; secondly, sift algorithm is used to extract features of objectives, the epipolar constraint is utilized to carry out stereo matching and the three-dimensional reconstruction for the objective feature points, in addition, fuzzy C-means algorithm(FCM) clustering is used to determine the three-dimensional coordinates of the center of moving multi-objectives; finally, Kalman filtering method is combined with to implement objective tracking. Experimental and analytical results show that the proposed algorithm can properly adapt to objective tracking in case of obstruction, it has good robustness and accuracy.
Key words: background subtraction method    sift algorithm    three-dimensional reconstruction    FCM clustering    Kalman filtering    three-dimensional coordinates    two-dimensional coordinates    stereo matching

1 基于背景差分的运动目标检测算法

 ${D_{_k}} = |{f_k} - {f_{bk}}|$
 ${B_k} = \left\{ {\begin{array}{*{20}{c}} {1,D(k) > T} \\ {0,D(k) \leqslant T} \end{array}} \right.$

2 基本算法原理 2.1 sift算法原理

sift算法是一种对两幅图像提取发生平移、旋转、变换等情况下的特征匹配[9]。sift算法由尺度不变性、关键点方向确定、特征向量生成、关键点位置等4部分组成。对于任何一副二维图像在不同尺度下可以用高斯卷积表示成

 $L(x,y,\sigma ) = G(x,y,\sigma ) * I(x,y)$

 $G(x,y,\sigma ) = \frac{1}{{2\pi {\sigma ^2}}}{{{e}}^{ - \frac{{{x^2} + {y^2}}}{{2{\sigma ^2}}}}}$

 $D(x,y,\sigma ) = (G(x,y,k\sigma ) - G(x,y,\sigma ))I(x,y)$

 $D(x) = D + \frac{{\partial {D^T}}}{{\partial x}}\Delta x + \frac{1}{2}\Delta {x^T}\frac{{{\partial ^2}{D^T}}}{{\partial {x^2}}}\Delta x$

 $\left\{ {\begin{array}{*{20}{c}} {x \in X|D(\mathop x\limits^ \wedge )| \geqslant {T_c},x \in {X_0}} \\ {x \notin X|D(\mathop x\limits^ \wedge )| < {T_c},x \in {X_0}} \end{array}} \right.$

 ${{H}} = \left[ {\begin{array}{*{20}{c}} {{D_{xx}}}&{{D_{xy}}} \\ {{D_{xy}}}&{{D_{yy}}} \end{array}} \right]$

 ${{Tr}}({{H}}) = {D_{xx}} + {D_{yy}} = \alpha + \beta$
 ${{Det}}({{H}}) = {D_{xx}}{D_{yy}} - {({D_{xy}})^2} = \alpha \beta$

H的迹和值比值为

 $\frac{{{{Tr}}{{({{H}})}^2}}}{{{{Det}}({{H}})}} = \frac{{{{(\alpha + \beta )}^2}}}{{\alpha \beta }} = \frac{{{{(\gamma + 1)}^2}}}{\gamma }$

 $\theta \left( {x,y} \right) = {\tan ^{ - 1}}\frac{{L\left( {x,y + 1} \right) - L\left( {x,y - 1} \right)}}{{L\left( {x + 1,y} \right) - L\left( {x - 1,y} \right)}}$
 \begin{aligned}& m\left( {x,y} \right) = \\& \sqrt {{{\left[ {L\left( {x + 1,y} \right) - L\left( {x - 1,y} \right)} \right]}^2} + {{\left[ {L\left( {x,y + 1} \right) - L\left( {x,y - 1} \right)} \right]}^2}} \end{aligned}

90帧图像和95帧图像提取的特征点都在运动目标区域上，2帧图像提取的特征点数分别为538和516，可以说明sift算法提取的特征点数很稳定。

2.2 极线约束原理

2.3 FCM聚类算法原理

FCM模糊聚类算法是将待聚类的数据分成多个模糊集，以各个样本到聚类中心的距离加权平均和最小作为判断的标准。FCM算法的隶属度矩阵U取值在[0, 1]，uij相加的总和为1。其公式表示为

 $\sum\limits_{i = 1}^c {{u_{ij}} = 1} ,\;j = 1,\;2,\; \cdots ,\;n$

 ${\lambda _m}\left( { u,\; v} \right) = \sum\limits_{i = 1}^c {\sum\limits_{j = 1}^n {u_{ij}^md_{ij}^2} }$

 ${u_{ij}} = \frac{1}{{\displaystyle\sum\nolimits_{i = 1}^c {{{\left( {{d_{ij}}/{d_{rj}}} \right)}^{2/\left( {m - 1} \right)}}} }}$
 ${v_i} = \frac{{\displaystyle\sum\nolimits_{j = 1}^n {u_{ij}^m{x_j}} }}{{\displaystyle\sum\nolimits_{j = 1}^n {u_{ij}^m} }}$
2.4 Kalman滤波

Kalman滤波算法一种线性离散滤波算法，是一种离散最优化的回归数据处理方法[12]，对于一种线性系统可以用一个随机过程运动方程来表示：

 ${{X}}(k) = {{AX}}(k - 1) + {{BU}}(k) + {{W}}(k)$ (1)

 ${{Z}}(k) = {{HX}}(k) + {{V}}(k)$ (2)

 ${{X}}(k|k - {{1}}) = {{AX}}(k - {{1}}|k{{ - 1}}) + {{BU}}(k)$

 ${{P}}(k|k{{ - 1}}) = {{AP}}(k{{ - 1}}|k{{ - 1}}){{{A}}^{ T}} + {{Q}}$ (3)

 ${{X}}(k|k) = {{X}}(k|k - 1) + {{kg}}(k)(Z(k) - {{HX}}(k|k - 1))$

Kalman增益方程矩阵为

 ${{kg}}(k) = {{P}}(k|k - 1){{{H}}^{ T}}/{({{HP}}(k|k - 1){{{H}}^{ T}} + {{R}})^{ T}}$ (4)

 ${ P}(k|k) = ({{I}} - { k{ g}}(k){{H}}){ P}(k|k - 1)$

3 基于三维坐标的运动目标跟踪 3.1 三维坐标的提取

1) 运用背景差分算法对运动目标检测。

2) 对目标区域进行特征点提取，本文使用的sift算法提取目标特征。

3) 双目极限约束算法对左右图像提取的特征点进行立体匹配，获得目标的深度信息。

4) 对目标的特征点进行三维重构并对误匹配的特征点进行剔除，以免影响目标三维坐标中心聚类的准确性。

5) 运用FCM算法的C均值聚类求得各个目标的三维聚类中心点，为结合Kalman滤波目标跟踪作准备。

3.2 三维坐标与Kalman滤波结合

 \left\{ {\begin{aligned}& {x\left( k \right) = x\left( {k - 1} \right) + {v_x}T} \\ & {y\left( k \right) = y\left( {k - 1} \right) + {v_y}T} \\ & {z\left( k \right) = z\left( {k - 1} \right) + {v_z}T} \end{aligned}} \right.

 ${ A}{{ = }}\left[ {\begin{array}{*{20}{c}}1 & 0 & 0 & T & 0 & 0\\0 & 1 & 0 & 0 & T & 0\\0 & 0 & 1 & 0 & 0 & T\\0 & 0 & 0 & 1 & 0 & 0\\0 & 0 & 0 & 0 & 1 & 0\\0 & 0 & 0 & 0 & 0 & 1\end{array}} \right]$ (5)

 ${ H}{{ = }}\left[ {\begin{array}{*{20}{c}}1 & 0 & 0 & 0 & 0 & 0\\0 & 1 & 0 & 0 & 0 & 0\\0 & 0 & 1 & 0 & 0 & 0\end{array}} \right]$ (6)

 $\begin{array}{l}\left[ {\begin{array}{*{20}{c}}{x(k)}\\[5pt]{y(k)}\\[5pt]{z(k)}\end{array}} \right]{{ = }}\left[ {\begin{array}{*{20}{c}}1 & 0 & 0 & T & 0 & 0\\[5pt]0 & 1 & 0 & 0 & T & 0\\[5pt]0 & 0 & 1 & 0 & 0 & T\\[5pt]0 & 0 & 0 & 1 & 0 & 0\\[5pt]0 & 0 & 0 & 0 & 1 & 0\\[5pt]0 & 0 & 0 & 0 & 0 & 1\end{array}} \right] \times \\\quad \quad \quad \quad \; \left[ {\begin{array}{*{20}{c}}{x(k - 1)}\\[5pt]{y(k - 1)}\\[5pt]{z(k - 1)}\\[5pt]{v{}_x}\\[5pt]{{v_y}}\\[5pt]{{v_z}}\end{array}} \right] + { W}(k)\end{array}$

 $\begin{array}{l}\left[ {\begin{array}{*{20}{c}}{x\left( k \right)}\\[6pt]{y\left( k \right)}\\[6pt]{z\left( k \right)}\end{array}} \right]{{ = }}\left[ {\begin{array}{*{20}{c}}1 & 0 & 0 & 0 & 0 & 0\\[6pt]0 & 1 & 0 & 0 & 0 & 0\\[6pt]0 & 0 & 1 & 0 & 0 & 0\end{array}} \right] \times \\[8pt]\quad \quad \quad \quad \,\,\, \left[ {\begin{array}{*{20}{c}}{x\left( k \right)}\\[6pt]{y\left( k \right)}\\[6pt]{z\left( k \right)}\\[6pt]{{v_x}}\\[6pt]{{v_y}}\\[6pt]{{v_z}}\end{array}} \right] + { V}\left( k \right)\end{array}$

Kalman滤波通过观测模型k时刻的三维坐标观测值和k时刻的三维坐标修正值得到k时刻的Kalman滤波三维坐标值，再通过k时刻的三维坐标滤波值预测k+1时刻的三维坐标预测值，至此Kalman滤波在修正和预测两个过程不断进行下去。

4 仿真结果

5 结论

1) 对于目标跟踪的场景大大提高，特别是对遮挡后跟踪的鲁棒性增加。

2) 加入了深度信息，分析推导了三维坐标与Kalman滤波结合对目标跟踪。

 [1] 谭艳, 王宇俊. 一种结合背景差分的改进CamShift目标跟踪方法[J]. 西南师范大学学报: 自然科学版, 2016, 41(9): 120-125. (0) [2] 翟明. 基于特征匹配与卡尔曼预测的多目标跟踪算法研究[D]. 沈阳: 东北大学, 2014: 1-55. http://cdmd.cnki.com.cn/Article/CDMD-10145-1016012179.htm (0) [3] KRIEGER E, SIDIKE P, ASPIRAS T, et al. Directional ringlet intensity feature transform for tracking[C]//Proceedings of 2015 IEEE International Conference on Image Processing. Quebec, Canada: IEEE, 2015: 3871−3875. (0) [4] BARBIERI T TDS, GOULARTE R. KS-SIFT: A keyframe extraction method based on local features[C]//Proceedings of 2014 IEEE International Symposium on Multimedia. Taichung, China: IEEE, 2014: 13−17. (0) [5] JI Wenping, GUO Baolong, DING Guiguang. Detecting traffic volume statistics based on virtual coil with optical flow method[J]. Computer simulation, 2004, 21(1): 109-110, 117. (0) [6] ASARI V K, ARIGELA S. Color image enhancement of low-resolution images captured in extreme lighting conditions[C]//Proceedings of SPIE 9120, Mobile Multimedia/Image Processing, Security, and Applications. Baltimore: SPIE, 2014: 91200Q. (0) [7] 姚放吾, 许辰铭. 基于目标质心的Meanshift跟踪算法[J]. 计算机技术与发展, 2012, 22(6): 104-106, 110. (0) [8] 郭文强, 高晓光, 侯勇严. 基于卡尔曼预测算法的云台三维空间目标跟踪[J]. 陕西科技大学学报, 2007, 25(3): 89-92. (0) [9] 余旺盛, 田孝华, 侯志强, 等. 基于关键区域特征匹配的视觉跟踪算法[J]. 电子学报, 2014, 42(11): 2150-2156. DOI:10.3969/j.issn.0372-2112.2014.11.004 (0) [10] SRIHARSHA K V, RAO N V. Dynamic scene analysis using Kalman filter and mean shift tracking algorithms[C]//Proceedings of 2015 6th International Conference on Computing, Communication and Networking Technologies. Denton: IEEE, 2016: 1−8. (0) [11] 曲海琴. 一种改进型运动目标检测算法及其在视频监控系统中的应用研究[D]. 长春: 吉林大学, 2013: 1-47. http://cdmd.cnki.com.cn/Article/CDMD-10183-1013193516.htm (0) [12] GIBSON J D, KOO B, GRAY S D. Filtering of colored noise for speech enhancement and coding[J]. IEEE transactions on signal processing, 1991, 39(8): 1732-1742. DOI:10.1109/78.91144 (0)