This link has sample on Template matching.Ideally there is an image and a template for matching.How do I get the result status as True/False if I provide a wrong template. http://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_imgproc/py_template_matching/py_template_matching.html
In the statement below can we get false if there is no match ?
res = cv2.matchTemplate(img,template,method)
No you can not. I am not familiar with python interface of OpenCV. However, Template matching return map of matches and the best matches is the point with the highest intensity. you can see this line from your link:
loc = np.where( res >= threshold)
threshold is what you are looking for. You can adjust a specific number that you do not accept a match that is below this threshold. Good luck with this because this threshold is so sensitive.
P.S. in real world problems Template matching is rarely works well. You may try to find a better approach.