[imgproc]Add template match with mask.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
Last remark :smile:  

Please add a doxygen documentation for the mask parameter (http://pullrequest.opencv.org/buildbot/builders/precommit_docs/builds/2125/steps/make%20doxygen/logs/warnings%20%281%29).