arXiv:2502.01286cs.CV2025-02被引 2

用分块均值近似模板,加速图像模板匹配计算。

Template Matching in Images using Segmented Normalized Cross-Correlation

  • 将模板分块为矩形区域,每块用均值代替原像素。
  • 计算效率优于FFT-NCC,误差极小,尤其适合小或简单模板。
  • 适用于对速度敏感但精度要求不苛刻的实时匹配场景。

本文提出一种新的归一化互相关(NCC)变体算法,用于图像模板匹配。该算法通过分段合并方法预计算模板近似表示,将模板分解为轴对齐的矩形片段,片段大小由其内部像素灰度方差决定。每个片段用原模板对应区域的平均灰度值替代。相比使用原始模板进行精确NCC计算,该方法可更高效地计算近似NCC。实验表明,在视觉结构简单或模板较小的情况下,该算法在计算性能上优于经典的基于快速傅里叶变换(FFT)的NCC算法,且近似误差可忽略不计。在其他情况下,该算法可在计算性能或近似误差上保持与FFT-NCC相当的水平,但无法同时兼顾两者。

原文摘要 · Abstract (English)

In this paper, a new variant of an algorithm for normalized cross-correlation (NCC) is proposed in the context of template matching in images. The proposed algorithm is based on the precomputation of a template image approximation, enabling more efficient calculation of approximate NCC with the source image than using the original template for exact NCC calculation. The approximate template is precomputed from the template image by a split-and-merge approach, resulting in a decomposition to axis-aligned rectangular segments, whose sizes depend on per-segment pixel intensity variance. In the approximate template, each segment is assigned the mean grayscale value of the corresponding pixels from the original template. The proposed algorithm achieves superior computational performance with negligible NCC approximation errors compared to the well-known Fast Fourier Transform (FFT)-based NCC algorithm, when applied on less visually complex and/or smaller template images. In other cases, the proposed algorithm can maintain either computational performance or NCC approximation error within the range of the FFT-based algorithm, but not both.

模板匹配图像处理加速算法

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。