- Template Matching is a method for searching and finding the location of a template image in a larger image.
- It is one of the simplest forms of object detection, where a template is basically slided over the reference image to find if there is a match.
- OpenCV provides a function to find matches, known as
cv2.matchTemplate()
- OpenCV offers various types of methods that aid in template matching, their working can be observed as follows
Method | Template Matching |
---|---|
cv2.TM_CCOEFF | |
cv2.TM_CCOEFF_NORMED | |
cv2.TM_CCORR | |
cv2.TM_CCORR_NORMED | |
cv2.TM_SQDIFF | |
cv2.TM_SQDIFF_NORMED |
- Among the above mentioned methods, we can clearly say that
cv2.TM_CCORR
doesn't provide an accurate match