High-precision Template Matching Tracking Algorithm for Optoelectronic Tracking System
-
摘要: 为实现在光电跟踪系统条件下的高精度测量并且满足复杂环境下高精度目标匹配,本文选用去均值归一化互相关匹配算法。为提高匹配速度以及跟踪实时性,利用和表法计算公式中图像求和、平方和图像匹配互相关来简化计算复杂度;采用小波分层金字塔法作为搜索策略,并将模板质心作为参考点进行十字形搜索,引入终止阈值减少误匹配点进一步提高搜索速度。为验证该算法的有效性,实验中将光电跟踪系统放置在二维转台上,调整转台利用该算法跟踪目标靶板。实验结果表明,目标脱靶量控制在3个像素以内,该算法在光电跟踪系统上可实现高精度稳定跟踪。Abstract: To achieve high-precision measurements under the operating conditions of optoelectronic tracking systems and satisfy high-precision target matching in complex environments, in this study we adopted the average normalized cross-correlation algorithm. To improve the matching speed and real-time tracking, the computational complexity was simplified by using the sum table method to correlate the sum of images, squares, and the correlation of images. The wavelet pyramid method was used as the search strategy, and the center of the template was used as the reference point for cross-shaped search. A termination threshold was introduced, which reduced the number of mismatched points to increase the search speed. To verify the effectiveness of the algorithm, an optoelectronic tracking system was placed on a two-dimensional turntable in an experiment that used the algorithm to track a target. The experimental results show that the missed target was controlled within 3 pixels. The proposed algorithm can realize high-precision and stable tracking in optoelectronic tracking systems.
-
表 1 计算复杂度对比
Table 1. Comparison of computational complexity
Image size: M×N
Window size: m×nThe traditional method The proposed method Addition/subtraction Multiplication Addition/subtraction Multiplication Construction of sum-tables S1 0 0 3×M×N 0 S2 0 0 3×M×N M×N S3 0 0 3×M×N M×N Calculation of NCC ∑∑ M×N×m×n 0 3×M×N 0 ∑∑f2 M×N×m×n M×N×m×n 3×M×N 0 ∑∑f·r M×N×m×n M×N×m×n 3×M×N 0 Total 3×M×N×m×n 2×M×N×m×n 18×M×N 2×M×N -
[1] 朱泓谕. 模板匹配技术在图像识别中的运用[J]. 电子技术与软件工程, 2021(5): 122-123. https://www.cnki.com.cn/Article/CJFDTOTAL-DZRU202105062.htmZHU Hongyu. Application of template matching technique in image recognition[J]. Electronic Technology & Software Engineering, 2021(5): 122-123. https://www.cnki.com.cn/Article/CJFDTOTAL-DZRU202105062.htm [2] Lewis J P. Fast normalized cross correlation[C]//Proceeding of Vision Interface, 1995: 120-123. [3] 陈翔, 陈鹏. 基于改进模板匹配的目标跟踪算法[J]. 计算机应用, 2011, 31(z2): 127-128. https://www.cnki.com.cn/Article/CJFDTOTAL-JSJY2011S2040.htmCHEN Xiang, CHEN Peng. Object tracking algorithm based on improved template matching[J]. Journal of Computer Applications, 2011, 31(z2): 127-128. https://www.cnki.com.cn/Article/CJFDTOTAL-JSJY2011S2040.htm [4] 谢维达, 周宇恒, 寇若岚. 一种改进的快速归一化互相关算法[J]. 同济大学学报(自然科学版), 2011, 39(8): 1233-1237. doi: 10.3969/j.issn.0253-374x.2011.08.025XIE Weida, ZHOU Yuheng, KOU Ruolan. An improved fast normalized cross correlation algorithm[J]. Journal of Tongji University (Natural Science), 2011, 39(8): 1233-1237. doi: 10.3969/j.issn.0253-374x.2011.08.025 [5] 王斌, 何中市, 伍星, 等. 基于高斯金字塔的图像运动估计算法[J]. 计算机工程与应用, 2015, 51(7): 174-178. doi: 10.3778/j.issn.1002-8331.1305-0110WANG Bin, HE Zhongshi, WU Xing, et al. Image motion estimation algorithm based on Gaussian pyramid[J]. Computer Engineering and Applications, 2015, 51(7): 174-178. doi: 10.3778/j.issn.1002-8331.1305-0110 [6] 胡敏, 贺晓佳, 王晓华. 快速区域质心图像匹配算法[J]. 电子测量与仪器学报, 2011, 25(5): 455-462. https://www.cnki.com.cn/Article/CJFDTOTAL-DZIY201105013.htmHU Min, HE Xiaojia, WANG Xiaohua. Fast image matching algorithm with area centroid[J]. Journal of Electronic Measurement and Instrumentation, 2011, 25(5): 455-462. https://www.cnki.com.cn/Article/CJFDTOTAL-DZIY201105013.htm [7] YANG Zhuo. Fast template matching based on normalized cross correlation with centroid bounding[C]//International Conference on Measuring Technology and Mechatronics Automation of IEEE, 2010: 224-227. [8] 穆欣侃, 罗海波. 一种对亮度变化鲁棒的相关跟踪方法[J]. 红外与激光工程, 2012, 40(1): 255-260. doi: 10.3969/j.issn.1007-2276.2012.01.048MU Xinkan, LUO Haibo. Correlation tracking approach robust to the variation of image brightness[J]. Infrared and Laser Engineering, 2012, 40(1): 255-260. doi: 10.3969/j.issn.1007-2276.2012.01.048 [9] 徐一鸣, 顾菊平, 袁媛, 等. 基于改进归一化积相关算法的目标跟踪方法研究[J]. 南通大学学报(自然科学版), 2013, 12(2): 11-15. doi: 10.3969/j.issn.1673-2340.2013.02.003XU Yiming, GU Juping, YUAN Yuan, et al. Research on target tracking method based on an improved normalized product correlation algorithm[J]. Journal of Nantong University(Natural Science Edition), 2013, 12(2): 11-15. doi: 10.3969/j.issn.1673-2340.2013.02.003 [10] WEI Shouder, LAI Shanghong. Fast template matching based on normalized cross correlation with adaptive multilevel winner update[J]. IEEE Transactions on Image Processing, 2008, 17(11): 2227-2235. doi: 10.1109/TIP.2008.2004615 [11] Tsai D M, LIN C T. Fast normalized cross correlation for defect detection[J]. Pattern Recognition Letters, 2003, 24: 2625-2631. doi: 10.1016/S0167-8655(03)00106-5 [12] Gharavi-Alkhansari M. A fast globally optimal algorithm for template matching using low-resolution pruning[J]. IEEE Transactions on Image Processing, 2001, 10(4): 526-533. doi: 10.1109/83.913587 [13] 吴强, 任琳, 张杰. 快速归一化互相关算法及DSP优化实现[J]. 电子测量与仪器学报, 2011, 25(6): 495-499. https://www.cnki.com.cn/Article/CJFDTOTAL-DZIY201106002.htmWU Qiang, REN Lin, ZHANG Jie. Fast algorithm of normalized cross correlation and optimized implementation on DSP[J]. Journal of Electronic Measurement and Instrument, 2011, 25(6): 495-499. https://www.cnki.com.cn/Article/CJFDTOTAL-DZIY201106002.htm [14] 陈岳军, 孙广玲, 姚恒. 结合小波金字塔的空频域亚像素图像配准[J]. 上海大学学报(自然科学版), 2012, 18(4): 342-348. doi: 10.3969/j.issn.1007-2861.2012.04.003CHEN Yuejun, SUN Guangling, YAO Heng. Hybrid spatial-frequency domain sub-pixel image registration with wavelet pyramid[J]. Journal of Shanghai University(Natural Science Edition), 2012, 18(4): 342-348. doi: 10.3969/j.issn.1007-2861.2012.04.003 [15] 吴鹏, 徐洪玲, 宋文龙. 结合小波金字塔的快速NCC图像匹配算法[J]. 哈尔滨工程大学学报, 2017, 38(5): 791-796. https://www.cnki.com.cn/Article/CJFDTOTAL-HEBG201705022.htmWU Peng, XU Hongling, SONG Wenlong. A fast NCC image matching algorithm based on wavelet pyramid search strategy[J]. Journal of Harbin Engineering University, 2017, 38(5): 791-796. https://www.cnki.com.cn/Article/CJFDTOTAL-HEBG201705022.htm [16] 刘元琳, 宋春凤, 王玲玲. 基于金字塔的渐进分辨率匹配算法研究[J]. 电子制作, 2020(20): 27-29. https://www.cnki.com.cn/Article/CJFDTOTAL-DZZZ202020012.htmLIU Yuanlin, SONG Chunfeng, WANG Lingling. Research on progressive resolution matching algorithm based on pyramid[J]. Electronic Production, 2020(20): 27-29. https://www.cnki.com.cn/Article/CJFDTOTAL-DZZZ202020012.htm [17] 张万绪, 吴佳丽, 赵丽平, 等. 改进的十字菱形搜索算法INCDS[J]. 西北大学学报(自然科学版), 2011, 41(2): 226-230. https://www.cnki.com.cn/Article/CJFDTOTAL-XBDZ201102009.htmZHANG Wanxu, WU Jiali, ZHAO Liping, et al. Improved new cross-diamond search algorithm INCDS[J]. Journal of Northwest University(Natural Science Edition), 2011, 41(2): 226-230. https://www.cnki.com.cn/Article/CJFDTOTAL-XBDZ201102009.htm