首页识别改进
Some checks failed
ci/woodpecker/push/check_format Pipeline failed

This commit is contained in:
zhbaor 2025-05-01 20:42:30 +08:00
parent 7f76f90f80
commit aaac1deaeb

View file

@ -89,12 +89,11 @@ class Recognizer:
def detect_index_scene(self) -> bool:
res = loadres("index_nav", True)
h, w = res.shape
img = cropimg(self.gray, ((25, 17), (25 + w, 17 + h)))
img = cropimg(self.gray, ((25, 17), (456, 96)))
img = thres2(img, 240)
result = cv2.matchTemplate(img, res, cv2.TM_SQDIFF_NORMED)
result = cv2.matchTemplate(img, res, cv2.TM_CCOEFF_NORMED)
result = result[0][0]
if result < 0.1:
if result > 0.85:
logger.debug(result)
return True
return False