flappy init

This commit is contained in:
2023-07-28 13:13:20 +02:00
parent c43399ac2a
commit bfd8690535
4 changed files with 34 additions and 66 deletions

View File

@@ -158,10 +158,11 @@ class Vision:
if mask is not None:
result = cv.matchTemplate(haystack_img, needle_img, cv.TM_CCORR_NORMED, None, mask)
_minVal, _maxVal, minLoc, maxLoc = cv.minMaxLoc(result, None)
else:
result = cv.matchTemplate(haystack_img, needle_img, self.method)
_minVal, _maxVal, minLoc, maxLoc = cv.minMaxLoc(result, None)
if normalize:
cv.normalize(result, result, 0, 1, cv.NORM_MINMAX, -1)
# Get the all the positions from the match result that exceed our threshold