Consider the problem where one searches the presence and position of a perfectly known sub-image in an image . The sub-image is called the pattern (French: motif). Then the cross-correlation (French: corrélation croisée) between and is a very efficient technique. This technique is often known as matched filter or template matching (French: filtre adapté).
The cross-correlation between and gives a new image defined as:
The cross-correlation can be calculated as a convolution, hence the term “filter” in the name of this technique.
Usually, and are normalized into:
where and (resp. and ) are respectively the mean and the standard deviation of the image (resp. ). This results in the normalized cross-correlation (French: corrélation croisée normalisée) which is insensitive to changes in amplitude:
Figure 1 gives an example of matched filter.
Figure 1:Normalized cross-correlation with the pattern shown top-left (the letter G).
As seen in Figure 2, the major limit of the matched filter is that it is sensitive to variations in orientation, size, etc.
Figure 2:Normalized cross-correlation with the pattern shown top-left (the digit 0).
To overcome this limit, one can apply several matched filters, each representative of all the variations of the patterns. However, this is very time-consuming!