Skip to content

Commit

Permalink
Fixed findAll issues
Browse files Browse the repository at this point in the history
  • Loading branch information
glitchassassin committed Jan 15, 2019
1 parent 6b772e6 commit 3684a5a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions lackey/RegionMatching.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ def findAll(self, pattern):
lastMatches = []
for match in matches:
position, confidence = match
position = ((position[0] + self.x, position[1] + self.y), (position[2], position[3]))
lastMatches.append(
Match(
confidence,
Expand Down
5 changes: 1 addition & 4 deletions lackey/TemplateMatchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,7 @@ def findAllMatches(self, needle, similarity):

# Erase the found match from the haystack.
# Repeat this process until no other matches are found
x, y = best_match[0]
w = needle.shape[1]
h = needle.shape[0]
roi = (x, y, w, h)
roi = best_match[0]
# numpy 2D slice
roi_slice = (slice(roi[1], roi[1]+roi[3]), slice(roi[0], roi[0]+roi[2]))
self.haystack[roi_slice] = 0
Expand Down

0 comments on commit 3684a5a

Please sign in to comment.