To address the shortcomings of traditional methods in terms of rotation, scale, illumination robustness, and computational efficiency, a template matching algorithm based on improved ring projection and fast dynamic time warping was proposed. In the feature extraction stage, an adaptive ring projection method was adopted, which achieved uniform sampling by dynamically adjusting the angle step size, and it was combined with Gaussian smoothing and illumination compensation to enhance the illumination robustness and noise resistance of feature extraction. In the template matching stage, the fast dynamic time warping algorithm was used to align ring projection sequences at different scales and directly calculate the scaling factor and matching distance. Radial projection was combined to calculate the rotation angle, and the step acceleration method was used to replace point-by-point traversal to improve search efficiency. Experiments on the test image set show that the matching accuracy within the scale range of 0.8~1.2 is greater than 97.5%, and the matching speed is increased by 1.84 times compared with the traditional ring projection algorithm.
最常用的相似性度量包括绝对差值总和(sum of absolute differences,SAD)、平方差和(sum of squared differences,SSD)和归一化互相关(normalized cross-correlation,NCC)[5],其中NCC具有更高的鲁棒性[6],而零均值归一化互相关(zero-mean normalized cross-correlation,ZNCC)在计算时减去窗口内的均值以克服光照和亮度的变化,使其广泛应用于物体识别和工业检测,但依然存在缺乏旋转不变性的缺陷[7-8].Lin[9]提出了一种基于环投影的匹配方法,环投影将目标的形状信息从二维空间转化为一维的投影特征,以互相关系数作为匹配分数标准,实现旋转不变性和尺度不变性,并可以通过径向投影计算具体的旋转角度[10].但基于环投影的模板匹配依然不具有尺度不变性,需要一组不同尺度的模板图像构建模板向量,无法通过单一模板实现多尺度的模板匹配[11].基于深度学习的模板匹配通过卷积神经网络提取图像特征,然后结合传统的密集特征相似度评估算法或简单的评估网络来实现模板匹配,如基于Siamese网络与NCC的模板匹配[12]、质量感知模板匹配[13]、广义模态不变特征变换[14]等,这些算法进一步提升了匹配的准确性和鲁棒性,也极大地拓宽了其应用范围,但对硬件平台也有更高的要求.动态时间规整(dynamic time warping,DTW)常用于语音模板的识别和匹配[15],可以处理非线性时间形变,如局部拉伸或压缩,适用于长度不同或存在局部时间偏移的序列的对齐,使得通过单一模板计算尺度因子成为可能.但与NCC相比,DTW的时间复杂度更高,在窗口遍历过程中占用过大的计算资源,当序列长度较大时无法满足匹配需求[16].快速动态时间规整(fast DTW)结合了区域限制和抽样,加速了DTW的计算[17].
动态时间规整(DTW)是一种用于衡量时间序列相似性的算法.DTW通过动态规划的方法,计算两个序列之间的距离矩阵,找到最佳对齐路径并将两序列对齐,使得对齐后的总距离最小.即使两个序列在时间轴上有不同程度的拉伸或压缩,也能准确计算它们的相似性,如图4所示.图中i,j分别表示序列 x 和序列 y 中的位置索引,矩阵网格中的各点表示序列 x 中的第i点与序列 y 中的第j点相匹配.当图像发生缩放时,模板图像和目标子图像的环投影序列的长度将按比例拉伸或压缩,而DTW尤其适用于处理不同长度或存在时间偏移的序列,可以解决匹配中的尺度变化问题.
fast DTW将两个序列对齐并返回两序列的距离,这将作为模板匹配的直接依据.同时能够得到两序列的距离矩阵和规整后的对齐路径,对齐后的序列长度相等,回溯路径,记录匹配点对.设表示模板序列中第个点的位置索引,表示待测序列中与匹配的第个点的位置索引,对于每组点对,局部尺度因子.由于当两序列尺度相差过大或相关性过低时都会造成Ki 过高或过低,同时当尺度相差过大时DTW难以将序列准确对齐,故只保留合理范围内的.改进环投影序列的起始点相同,而由于两序列初始长度不同,模板图像与相同大小的子图像的环投影序列末端差异过大,保留序列中间1/5到4/5部分的值以提高尺度因子计算的准确性.设Ki 序列长度为l,则平均尺度因子为
YangX Y. Motion target tracking algorithm based on improved multi-correlation template matching[C]//2025 IEEE International Conference on Computation, Big-Data and Engineering (ICCBE). Penang, 2025: 741-746.
[2]
LvC H, WangW, QuanD, et al. Fourier domain adaptive multi-modal remote sensing image template matching based on Siamese network[C]//IGARSS 2024—2024 IEEE International Geoscience and Remote Sensing Symposium. Athens, 2024: 7325-7329.
[3]
YangJ S, ZhengY B, XuW Y, et al. An accurate and robust multimodal template matching method based on center-point localization in remote sensing imagery[J]. Remote Sensing, 2024, 16(15): 2831.
[4]
MeiL C, WangC Y, WangH Y, et al. Fast template matching in multi-modal image under pixel distribution mapping[J]. Infrared Physics & Technology, 2022, 127: 104454.
[5]
AlmiraJ M, PhelippeauH, Martinez-SanchezA. Fast normalized cross-correlation for template matching with rotations[J]. Journal of Applied Mathematics and Computing, 2024, 70(5): 4937-4969.
[6]
HuM Q, SunB, KangX D, et al. Multiscale structural feature transform for multi-modal image matching[J]. Information Fusion, 2023, 95: 341-354.
[7]
MattocciaS, TombariF, Di StefanoL. Reliable rejection of mismatching candidates for efficient ZNCC template matching[C]//2008 15th IEEE International Conference on Image Processing. San Diego, 2008: 849-852.
[8]
ShenY P, LiS X, SongY, et al. Ordering pixels for fast ZNCC template matching[C]//2013 IEEE International Conference of IEEE Region 10 (TENCON 2013). Xi’an, 2014: 1-5.
[9]
LinY H. New method for subpixel image matching with rotation invariance by combining the parametric template method and the ring projection transform process[J]. Optical Engineering, 2006, 45(6): 067202.
[10]
LeeW C, ChenC H. A fast template matching method with rotation invariance by combining the circular projection transform process and bounded partial correlation[J]. IEEE Signal Processing Letters, 2012, 19(11): 737-740.
[11]
QiX W, MiaoL G. A template matching method for multi-scale and rotated images using ring projection vector conversion[C]//2018 IEEE 3rd International Conference on Image, Vision and Computing (ICIVC). Chongqing, 2018: 45-49.
[12]
BuniatyanD, MacrinaT, IhD, et al. Deep learning improves template matching by normalized cross correlation[EB/OL]. (2017-05-24) [2025-04-15].
[13]
YangJ S, ZhengY B, XuW Y, et al. An accurate and robust multimodal template matching method based on center-point localization in remote sensing imagery[J]. Remote Sensing, 2024, 16(15): 2831.
[14]
FanZ L, PiY D, WangM, et al. GLS-MIFT: a modality invariant feature transform with global-to-local searching[J]. Information Fusion, 2024, 105: 102252.
[15]
AlkhafajiM J A. QATM-KCNN: improving template matching performance based on integration of CNNs and with QATM by Kalman filtering[J]. Journal of Information Systems Engineering and Management, 2025, 10(25s): 93-104.
[16]
HwangY. Fast constrained sparse dynamic time warping[J]. Applied and Computational Engineering, 2025, 120(1): 50-58.
[17]
CaiQ L, ChenL Y, ShaoJ, et al. AdaPDTW: an efficient abstract-adaptive piecewise dynamic time warping for time series classification[J]. IEEE Access, 2025, 13: 84188-84201.
[18]
WangY L, LiuW, LiF, et al. A fast template matching method based on improved ring projection transformation and local dynamic time warping[J]. Optik, 2020, 216: 164954.
[19]
CuiL F, ZhangQ Z, ShiY, et al. A method for satellite time series anomaly detection based on fast-DTW and improved-KNN[J]. Chinese Journal of Aeronautics, 2023, 36(2): 149-159.
LiuYan-song, MiaoLi-gang, LiuYi-peng. Positioning and identification of automobile wheel hub based on ring projection feature[J]. Machine Tool & Hydraulics, 2020, 48(14): 73-77.
ChengJiang-han, XiaJiang-nan, LiYi, et al. Design of high-resolution remote sensing image system based on FPGA[J]. Journal of Telemetry, Tracking and Command, 2025, 46(2): 109-115.