金字塔模板匹配算法融合NMSFast以及优化研究
Integration of Pyramid Template Matching Algorithm with NMSFast and Optimization Techniques
DOI: 10.12677/ORF.2023.134400, PDF,    国家自然科学基金支持
作者: 袁学枫, 周 骅*, 易 忠:贵州大学大数据与信息工程学院,贵州 贵阳;赵 麒:贵州民族大学机械电子工程学院,贵州 贵阳
关键词: 金字塔模板匹配NMSFast特征提取查表优化OpenMP并行编程量化Pyramid Template Matching NMSFast Feature Extraction Lookup Table Optimization OpenMP Parallel Programming Quantization
摘要: 图像模板匹配是计算机视觉领域的一项重要任务,它在许多应用中都有广泛的应用。然而,传统的模板匹配算法在大规模图像和复杂场景下存在计算量大、效率低的问题。为了解决这些问题,本文提出融合快速非最大抑制(NMSFast)的金字塔模板匹配算法,提高准确度,并通过特征提取、查表优化、OpenMP并行、量化等技术对其优化,从而提高效率。基于Sobel获取图像的梯度信息,并结合阈值和强度条件来筛选候选特征点以达到特征提取。通过查表创建模板特征和对应搜索图像特征之间的关联关系和缩放因子和旋转角度对应的变换矩阵的索引表。将特征数据进行量化,其转换为更简单的浮点数,对角度图像进行8方向量化,结合阈值过滤无效角度值。以上优化能够减少计算量和存储空间的消耗。OpenMP并行技术对金字塔进行并行分层搜索,将单线程变成多线程,可以提高算法的运行速度。实验结果表明,所提出的金字塔模板匹配算法融合NMSFast算法在大规模图像匹配任务中,运算时间提高51%,精度提高1.7%。
Abstract: Template matching in image processing is an important task in the field of computer vision and has wide applications in various domains. However, traditional template matching algorithms suffer from high computational complexity and low efficiency, especially when dealing with large-scale images and complex scenes. To address these issues, this paper proposes a pyramid template matching algorithm that integrates the NMSFast (Non-Maximum Suppression Fast) al-gorithm for improved accuracy. Several optimization techniques, including feature extraction, table lookup optimization, OpenMP parallel programming, and quantization, are employed to enhance the efficiency of the algorithm. The proposed algorithm utilizes the Sobel operator to extract gradient information from images and applies thresholding and intensity conditions to filter candidate feature points during feature extraction. Table lookup is used to establish the correspondence between template features and the corresponding features in the search image, along with indexing tables for scaling factors and rotation angles. Feature data are quantized to simplify representation, converting them into floating-point numbers. The angle image is quantized into 8 directions, and invalid angle values are filtered out using thresholding. These optimizations significantly reduce computational complexity and storage requirements. The OpenMP parallel programming technique is employed to perform parallel hierarchical searches on the pyramid, transforming the algorithm from single-threaded to multi-threaded, thereby improving its runtime performance. Experimental results demonstrate that the proposed pyramid template matching algorithm integrated with NMSFast achieves a 51% reduction in computation time and a 1.7% improvement in accuracy for large-scale image matching tasks.
文章引用:袁学枫, 周骅, 赵麒, 易忠. 金字塔模板匹配算法融合NMSFast以及优化研究[J]. 运筹与模糊学, 2023, 13(4): 3994-4003. https://doi.org/10.12677/ORF.2023.134400

参考文献

[1] 杨睿宁, 惠飞, 金鑫, 等. 改进YOLOv5s的复杂交通场景路侧目标检测算法[J/OL]. 计算机工程与应用: 1-14. http://kns.cnki.net/kcms/detail/11.2127.TP.20230523.1741.010.html, 2023-08-16.
[2] 李文静, 白静, 彭斌, 等. 图卷积神经网络及其在图像识别领域的应用综述[J/OL]. 计算机工程与应用: 1-25. http://kns.cnki.net/kcms/detail/11.2127.tp.20230512.1640.016.html, 2023-08-16.
[3] 屈东东, 贺利乐, 何林. 一种改进的轻量化人脸识别算法[J]. 智能系统学报, 2023, 18(3): 544-551.
[4] 王钊, 刘广瑞, 孟少飞. 一种基于最佳相似性的人脸检测算法[J]. 计算机应用与软件, 2021, 38(11): 215-218.
[5] 苏欣, 赖复尧, 余容平, 等. 基于多视角模板匹配的零件图像检索方法[J]. 机械制造与自动化, 2023, 52(1): 222- 225+229. [Google Scholar] [CrossRef
[6] 朱鸣镝, 陈婵, 孙东岳. 基于特征点匹配的改进模板匹配算法[J]. 计算机与数字工程, 2022, 50(2): 377-382.
[7] 张琬迎, 刘昊, 蔡万鹏. 基于改进模板匹配算法的手势识别研究[J]. 北京服装学院学报(自然科学版), 2022, 42(3): 51-57.
[8] Khayam, K.N., Mehmood, Z., Chaudhry, H.N., Ashraf, M.U., Tariq, U., Altouri, M.N. and Alsubhi, K. (2022) Local-Tetra-Patterns for Face Recognition Encoded on Spatial Pyramid Matching. Computers, Materials & Continua, 70, 5039-5058. [Google Scholar] [CrossRef
[9] 逯睿琦, 马惠敏. 多尺度显著性区域提取的模板匹配[J]. 光学精密工程, 2018, 26(11): 2776-2784.
[10] 刘元琳, 宋春凤, 王玲玲. 基于金字塔的渐进分辨率匹配算法研究[J]. 电子制作, 2020(20): 27-29.
[11] 刘思丹, 卓勇, 施哲彦, 等. 改进的模板匹配金字塔搜索算法[J]. 激光杂志, 2023, 44(1): 42-47.
[12] 徐印赟, 江明, 李云飞, 等. 基于改进YOLO及NMS的水果目标检测[J]. 电子测量与仪器学报, 2022, 36(4): 114-123.
[13] 杜永生, 蒿琳, 石秦峰. 低质量红外偏振图像热像特征提取方法[J]. 激光杂志, 2022, 43(11): 159-163.
[14] 陈士安, 仝嘉成, 蒋旭东, 等. 基于调制白噪声与查表法的非平稳路面不平度建模方法[J]. 交通运输工程学报, 2020, 20(6): 171-179.
[15] Oyelade, O.N. and Ezugwu, A.E. (2022) Immuni-ty-Based Ebola Optimization Search Algorithm for Minimization of Feature Extraction with Reduction in Digital Mammography Using CNN Models. Scientific Reports, 12, Article Number 17916. [Google Scholar] [CrossRef] [PubMed]
[16] 聂慧, 李康顺, 苏洋. 一种量化因子自适应学习量化训练算法[J]. 系统仿真学报, 2022, 34(7): 1639-1650.
[17] Kim, J.S., Jang, J.H., Kim, Y.J. and Kim, K.S. (2022) Quantification of Notch Type and Specimen Thickness Effects on Ductile and Brittle Fracture Behaviour of Drop Weight Tear Test. European Journal of Mechanics-A/Solids, 92, Article ID: 104466. [Google Scholar] [CrossRef
[18] Ketchaya, S. and Rattanatranurak, A. (2023) Parallel Multi-Deque Partition Dual-Deque Merge Sorting Algorithm Using OpenMP. Scientific Reports, 13, Article No. 6408. [Google Scholar] [CrossRef] [PubMed]
[19] 陈清江, 顾媛, 李金阳. 双分支金字塔网络的微光图像增强算法[J]. 液晶与显示, 2022, 37(3): 395-404.
[20] 韩硕, 陈晓荣, 张彩霞, 等. 基于改进模板匹配算法的物料计数方法研究[J]. 计量学报, 2022, 43(7): 863-868.
[21] 闫河, 李晓玲, 谢敏, 等. 基于高斯金字塔与新粒子群的印刷电路板装配模板匹配算法[J]. 计算机集成制造系统, 2022(6): 1854-1859. [Google Scholar] [CrossRef