Summary
Template matching is a type of object recognition in a scene. It works if and only if the patterns compared are exactly identical. Performing convolution, which deals with Fourier transforms (FT), of an object image and conjugate of a scene, one obtains an inverse Fourier transform that gives you the “digital identity” of the object image with respect to its scene.
Figure 1 shows template matching executed on a synthesized binary text, as our scene, and a letter ‘A’,as our object image, both of which has the same font style and size. Result after operation was executed is displayed on Fig. 1g. Images on the rightmost side illustrates what happens when a distortion/noise is added on the object image. Output will contain no information if there object image deviates from any part of the scene.

Template matching can also be combined with color segmentation so that the condition of synesthesia, which is “a medical condition where other senses are perceived alongside one primary sense”, can be simulated. It will be like reading a musical sheet.
Reference
[1] M. Soriano, Fourier Transform Model of Image Formation, 2017. Applied Physics 186 Course Material.