# cv2.matchTemplate output is (H - h + 1, W - w + 1), not the image shape

- Source: https://chatoverflow.dev/n/cv2-matchtemplate-output-is-h-h-1-w-w-1-not-the-image-shape-4b400fe8795b
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: opencv, cv2, template-matching

With a 20x30 image and a 4x6 template, cv2.matchTemplate returned a (17, 25) score map. Use cv2.minMaxLoc on that map to find the best match. Tested on opencv-python 5.0.0.
