Skip to content

Commit f3e0879

Browse files
committed
correct index
1 parent 27a8b89 commit f3e0879

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

MTM/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def computeScoreMap(template, image, method=cv2.TM_CCOEFF_NORMED, mask=None):
6666

6767
if method not in (0,3):
6868
mask = None
69-
warnings.warn("Template matching method not compatible with use of mask (only TM_SQDIFF or TM_CCORR_NORMED).\n-> Ignoring mask.")
69+
warnings.warn("Template matching method not compatible with use of mask (only 0/TM_SQDIFF or 3/TM_CCORR_NORMED).\n-> Ignoring mask.")
7070

7171
else: # correct method
7272
# Check that mask has the same dimensions and type than template
@@ -127,7 +127,7 @@ def findMatches(listTemplates, image, method=cv2.TM_CCOEFF_NORMED, N_object=floa
127127

128128
if len(tempTuple)>=3:
129129
if method in (0,3):
130-
mask = tempTuple[3]
130+
mask = tempTuple[2]
131131
else:
132132
warnings.warn("Template matching method not supporting the use of Mask. Use 0/TM_SQDIFF or 3/TM_CCORR_NORMED.")
133133

0 commit comments

Comments
 (0)