摘要
当前模板匹配算法中,基于灰度的模板匹配算法具有较好的稳定性和鲁棒性.但是对于大型图像和复杂模板,它可能需要大量的计算资源和时间.此外,在应对目标尺度变化较大时,基于灰度的模板匹配算法匹配效果较差.对于NCC算法自身速度较慢的问题,本文对NCC算法进行了改进,减少了平均36%的匹配时间.为了应对多尺度的问题,本文结合卷积神经网络,提出了基于卷积神经网络和NCC的两阶段的多尺度高精度定位的模板匹配算法.其中,在一阶段目标检测阶段,本文在YOLOX算法的基础上改进了主干网络和损失函数,改善了算法的计算速度以及匹配成功率,并利用一阶段目标检测的结果使二阶段NCC算法动态调整模板大小,极大地减少了NCC算法大规模制作模板时间,最终使得整体匹配精度远远高于传统基于灰度的模板匹配算法.
Among the current template matching algorithms,grayscale-based methods have good stability and robustness.However,their efficacy may be hindered by the demands of processing large images and intricate templates,necessitating substantial computational resources and time.Additionally,when confronted with significant changes in target scale,grayscale-based template matching algorithms have poor matching performance.For the problem of slow speed of the Normalized Cross-Correlation(NCC)algorithm itself,this paper improves the NCC algorithm,resulting in a 36%reduction in average matching time.To address the challenge of multi-scale,this paper proposes a two-stage multi-scale high-precision positioning template matching algorithm that integrates convolutional neural networks and NCC.During the target detection phase in the first stage,this paper enhances the backbone network and loss function on the basis of the YOLOX algorithm,leading to improved algorithm calculation speed and matching success rate.The NCC algorithm in the second stage dynamically adjusts the template size based on the results of the first stage,significantly reducing the time required for template generation on a large scale.As a result,the overall matching accuracy surpasses that of traditional grayscale-based template matching algorithms.
作者
蒲宝林
张卫华
蒲亦非
PU Bao-Lin;ZHANG Wei-Hua;PU Yi-Fei(College of Computer Science,Sichuan University,Chengdu 610065,China)
出处
《四川大学学报(自然科学版)》
CAS
CSCD
北大核心
2024年第4期203-213,共11页
Journal of Sichuan University(Natural Science Edition)
基金
国家自然科学基金面上项目(62171303)。
关键词
模板匹配
多尺度
卷积神经网络
两阶段
YOLOX
Template matching
Multi-scale
Convolutional neural network
Two stages
YOLOX