Add support for mask with template
The comparison of the pixel values can be limited to a fraction of the template by providing an associated mask image, which should have the same dimension than the template.
To do so the tuple for a given template should be
("label", template_array, mask_array)
using a mask is only possible with method 0/TM_SQ_DIFF (not compatible with the Non-Maxima suppression though) and 3/TM_CCORR_NORMED
using a mask is optional (and not always beneficial)
the previous format
("label", template_array)
is still acceptable and within the list of templates, some can have a mask while other not.
See new tutorial with mask.