diff --git a/Tuts/template_matching.py b/Tuts/template_matching.py index a7044f6..d0caf12 100644 --- a/Tuts/template_matching.py +++ b/Tuts/template_matching.py @@ -12,7 +12,7 @@ img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY) template = cv2.imread('opencv-template-for-matching.jpg',0) -w, h = template.shape[::-1] +w, h = template.shape res = cv2.matchTemplate(img_gray,template,cv2.TM_CCOEFF_NORMED) threshold = 0.8 @@ -23,4 +23,4 @@ cv2.imshow('Detected', img_rgb) cv2.waitKey(0) -cv2.destroyAllWindows() \ No newline at end of file +cv2.destroyAllWindows()