A basic method of template matching uses a convolution mask (template), tailored to a specific feature of the search image, which we want to detect.
This method is normally implemented by first picking out a part of the search image to use as a template: We will call the search image S(x, y), where (x, y) represent the coordinates of each pixel in the search image.