Template matching algorithm for two-stage multi-scale high-precision positioning based on Convolutional neural network and 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 intri-cate 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 al-gorithm,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 re-ducing 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.