From d5a5b0e85f66f4d755c9040c5aa44c6c605fbd23 Mon Sep 17 00:00:00 2001 From: Ken Shirriff Date: Wed, 7 May 2025 16:50:15 -0700 Subject: [PATCH] Update match_template.py to fix doc bug shape has Y first, then X. See issue #27292 --- .../tutorial_code/imgProc/match_template/match_template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/python/tutorial_code/imgProc/match_template/match_template.py b/samples/python/tutorial_code/imgProc/match_template/match_template.py index 25c6e3bc04..ee5ed894b3 100644 --- a/samples/python/tutorial_code/imgProc/match_template/match_template.py +++ b/samples/python/tutorial_code/imgProc/match_template/match_template.py @@ -86,8 +86,8 @@ def MatchingMethod(param): ## [match_loc] ## [imshow] - cv.rectangle(img_display, matchLoc, (matchLoc[0] + templ.shape[0], matchLoc[1] + templ.shape[1]), (0,0,0), 2, 8, 0 ) - cv.rectangle(result, matchLoc, (matchLoc[0] + templ.shape[0], matchLoc[1] + templ.shape[1]), (0,0,0), 2, 8, 0 ) + cv.rectangle(img_display, matchLoc, (matchLoc[0] + templ.shape[1], matchLoc[1] + templ.shape[0]), (0,0,0), 2, 8, 0 ) + cv.rectangle(result, matchLoc, (matchLoc[0] + templ.shape[1], matchLoc[1] + templ.shape[0]), (0,0,0), 2, 8, 0 ) cv.imshow(image_window, img_display) cv.imshow(result_window, result) ## [imshow]