﻿ 融合帧间差分与碰撞算法的快速跟踪预测算法
 计算机系统应用  2018, Vol. 27 Issue (12): 136-142 PDF

Fast Tracking and Prediction Algorithm Based on Inter Frame Difference and Collision Algorithm
LI Kai-Qiang, SHEN Jian-Xin
College of Mechanical and Electrical Engineering, Nanjing University of Aeronautics and Astronautics, Nanjing 210016, China
Abstract: The traditional moving target tracking and prediction algorithm is difficult to ensure that the robot can capture and predict the high-speed moving targets in advance. In particular, the collision of moving targets in the course of sliding changes the original motion direction. Aiming at this problem, a moving target tracking prediction algorithm based on frame difference and collision algorithm is proposed. Through the inter frame difference method, the specific position and velocity of the moving object in the plane are identified quickly, and the collision of the moving target is judged according to the direction of motion velocity. When the moving targets collide in the process of motion, the collision simulation model is established by using the LS-DYNA dynamic analysis software, and the collision algorithm is obtained by fitting the simulation data with MATLAB, and the motion trajectory of the moving target is predicted by the collision algorithm. The results show that the moving target detection and tracking algorithm, which combines the inter frame difference and the collision algorithm, is faster for the tracking and prediction of the moving target in the plane, and can fully meet the requirements of the robot’s fast algorithm.
Key words: moving target detection     interframe difference method     collision algorithm     trajectory prediction

1 运动目标冰球检测算法 1.1 运动目标检测算法的种类及特点

1.2 帧差法对冰球目标的检测

 ${D_k}\left( {x\left. {,y} \right)} \right. = \left| {{I_{k + 1}}\left( {x\left. {,y} \right)} \right. - {I_k}\left( {x\left. {,y} \right)} \right.} \right|$ (1)
 图 1 帧间差分图像

 ${R_k}\left( {x,y} \right) =\left\{ {\begin{array}{*{20}{c}}{1,}&{{{{D}}_k}\left( {x,y} \right) > T}\\{0,}&{{\text{其他}}}\end{array}} \right.$ (2)

 图 2 差分图像二值化

 图 3 冰球轮廓最小外接圆

 图 4 冰球在像素坐标中的位置

2 碰撞算法

2.1 不同运动状态下仿真数据的收集

2.2 数据拟合

 图 5 X轴方向速度拟合

 图 6 Y轴方向速

X轴方向速度函数关系式:

 ${V_{\_x}} = 0.9974{V_x} - 0.00606$ (3)

Y轴方向速度函数关系式:

 ${V_{\_y}} = ({\rm{ - }}0.8392){V_y} - 0.000398$ (4)

3 轨迹预测算法及实验验证

3.1 滑行中无碰撞的轨迹预测实验

3.1.1 滑行中无碰撞的轨迹预测算法

 图 7 算法运行流程图

 图 8 无碰撞轨迹预测示意图

 ${V_x} = {x_2} - {x_1}$ (5)
 ${V_y} = {y_2} - {y_1}$ (6)

 $T = \frac{{{X_L} - {x_2}}}{{{V_x}}}$ (7)
 ${Y_L} = {y_2} + {V_y} \times T$ (8)

3.1.2 无碰撞的轨迹预测实验验证

 图 9 检测到冰球位置(一)

 图 10 检测到冰球位置(二)

 图 11 无碰撞时冰球目标轨迹

 图 12 检测到实际目标位置

3.2 滑行中与桌边发生碰撞的轨迹预测实验

3.2.1 滑行中有碰撞的轨迹预测算法

 ${V_x} = {x_2} - {x_1}$ (9)
 ${V_y} = {y_2} - {y_1}$ (10)

 图 13 冰球轨迹预测示意图

(1)冰球在Y方向上的帧速沿负方向

 ${T_1} = \frac{{{y_2} - R}}{{{V_y}}}$ (11)

 ${x_0} = {x_2} + {T_1} \times {V_x}$ (12)

 ${T_2} = \frac{{{X_L} - {x_0}}}{{{V_{\_x}}}}$ (13)

 ${Y_L} = R + {V_{\_y}} \times {T_2}$ (14)

(2)冰球在Y方向上的帧速沿正方向

 ${T'_1} = \frac{{370 - R - {y_2}}}{{{V_y}}}$ (15)

 ${x_0} = {x_2} + {T'_1} \times {V_x}$ (16)

 ${T'_2} = \frac{{{X_L} - {{x'}_0}}}{{{V_{\_x}}}}$ (17)

 ${Y_L} = 370 - R - {V_{\_y}} \times {T'_2}$ (18)
3.2.2 碰撞轨迹预测实验验证

 图 14 检测到冰球位置(一)

 图 15 检测到冰球位置(二)

 图 16 碰撞时冰球目标轨迹

 图 17 实际冰球位置

 图 18 算法运行时间

4 结束语

 [1] 章逸丰. 快速飞行物体的状态估计和轨迹预测[博士学位论文]. 杭州: 浙江大学, 2015. [2] 石龙伟, 邓欣, 王进, 等. 基于光流法和卡尔曼滤波的多目标跟踪. 计算机应用, 2017, 37(S1): 131-136. [3] 王彬, 马永杰, 李鹏飞. 结合分块的改进三帧差和背景差的运动目标检测. 计算机系统应用, 2015, 24(8): 155-159. DOI:10.3969/j.issn.1003-3254.2015.08.027 [4] 孙挺, 齐迎春, 耿国华. 基于帧间差分和背景差分的运动目标检测算法. 吉林大学学报(工学版), 2016, 46(4): 1325-1329. [5] 胡平, 周文洪. 基于帧间差分和边缘差分的遗留物检测算法. 计算机系统应用, 2015, 24(3): 171-175. DOI:10.3969/j.issn.1003-3254.2015.03.029 [6] Cheng YH, Wang J. A motion image detection method based on the inter-frame difference method. Applied Mechanics and Materials, 2014, 490-491: 1283-1286. DOI:10.4028/www.scientific.net/AMM.490-491 [7] 张娜, 魏海平, 于红绯. 一种融合特征点与运动补偿信息的运动目标检测新算法. 计算机应用与软件, 2017, 34(11): 210-216. DOI:10.3969/j.issn.1000-386x.2017.11.039 [8] Asif M, Taj IA, Ziauddin SM, et al. An efficient inter prediction mode selection scheme for advanced video coding based on motion homogeneity and residual complexity. IEEJ Transactions on Electrical and Electronic Engineering, 2016, 11(6): 760-767. DOI:10.1002/tee.2016.11.issue-6 [9] 于英华, 郎国军. 基于LS-DYNA的汽车保险杠碰撞仿真研究. 计算机仿真, 2017, 24(12): 235-238. [10] Liu CK, Song XP, Wang J. Simulation analysis of car front collision based on LS-DYNA and hyper works. Journal of Transportation Technologies, 2014, 4(4): 337-342. DOI:10.4236/jtts.2014.44030 [11] Zhang WQ. Dynamic simulation and curve fitting of folding furniture based on geometric analysis and MATLAB. Procee-dings of the 2nd International Conference on Materials Science, Machinery and Energy Engineering. Hong Kong, China. 2017, 123: 697–701. [12] 章梦杰, 邵培南, 于铭华. 多维空间中基于模式的移动对象轨迹预测. 计算机系统应用, 2018, 27(1): 113-119. DOI:10.15888/j.cnki.csa.006158