Template Matching
We use template matching to identify the occurrence of an image patch
(in this case, a sub-image centered on a single coin). Here, we
return a single match (the exact same coin), so the maximum value in the
match_template result corresponds to the coin location. The other coins
look similar, and thus have local maxima; if you expect multiple matches, you
should use a proper peak-finding function.
The match_template function uses fast, normalized cross-correlation [1]
to find instances of the template in the image. Note that the peaks in the
output of match_template correspond to the origin (i.e. top-left corner) of
the template.