Template matching using fast normalized cross correlation

In this paper, we present an algorithm for fast calculation of the normalized cross correlation and its application to the problem of template matching. Given a template t, whose position is to be determined in an image f, the basic idea of the algorithm is to represent the template, for which the normalized cross correlation is calculated, as a sum of rectangular basis functions. Then the correlation is calculated for each basis function instead of the whole template. The result of the correlation of the template t and the image f is obtained as the weighted sum of the correlation functions of the basis functions. Depending on the approximation, the algorithm can by far outperform Fourier-transform based implementations of the normalized cross correlation algorithm and it is especially suited to problems, where many different templates are to be found in the same image f.