Hi,
Template is the pattern you want to find in the image. For example if you are looking for circles in an image, a smaller image containing only a circle is the template. Once you calculate the cross-correlation between a template T and an image I, you obtain an image X.
The location of the pixel with the highest value in X will give you the location of the most similar pattern in I.
In the link below, it is very clearly explained how to do cross-correlation and how to calculate the coordinates of the found pattern using the information returned from the function normxcorr2.
**broken link removed**
Regards.