[imgproc]Add template match with mask.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
@ilya-lavrenov Thanks for your review. I also want implement it like this initially. But I found it may have no share code with matchTemplate. If you think the mode is better, I could change it. matchTemplateMask could be internal function which is called in matchTemplate(). Do you agree it?