Skip to content

Commit 4def997

Browse files
committed
🐛 fix(template-matching): 禁用模板动态缩放
1 parent fcb5eae commit 4def997

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/tasks/fullauto/ImportTask.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,10 @@ def match_map(self, index, max_conf=0.0, pattern=None): # 建议给 max_conf
348348

349349
count += 1
350350

351-
if self.height != 1080:
352-
scale_factor = self.height / 1080
353-
template_gray = cv2.resize(template_gray, (0, 0), fx=scale_factor, fy=scale_factor, interpolation=cv2.INTER_LINEAR)
351+
# if self.height != 1080:
352+
# scale_factor = self.height / 1080
353+
# template_gray = cv2.resize(template_gray, (0, 0), fx=scale_factor, fy=scale_factor, interpolation=cv2.INTER_LINEAR)
354+
354355
# 执行匹配
355356
result = cv2.matchTemplate(screen_gray, template_gray, cv2.TM_CCOEFF_NORMED)
356357
_, threshold, _, _, = cv2.minMaxLoc(result)

0 commit comments

Comments
 (0)