This commit is contained in:
parent
7f76f90f80
commit
aaac1deaeb
1 changed files with 3 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue