Skip to content

Commit

Permalink
降低Scene 9检测阈值、缩小检测范围
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoZuohong committed Nov 23, 2023
1 parent afcf575 commit 920a7b7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arknights_mower/utils/recognize.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def __init__(self, device: Device, screencap: bytes = None) -> None:
self.start(screencap)
self.loading_time = 0
self.LOADING_TIME_LIMIT = 5
self.CONN_SCOPE = ((1087, 978), (1430, 1017))
self.CONN_PRESCORE = 0.15

def start(self, screencap: bytes = None, build: bool = True) -> None:
""" init with screencap, build matcher """
Expand Down Expand Up @@ -65,7 +67,7 @@ def get_scene(self) -> int:
""" get the current scene in the game """
if self.scene != Scene.UNDEFINED:
return self.scene
if self.find('connecting', scope=((self.w//2, self.h//10*8), (self.w//4*3, self.h)), score=0.3) is not None:
if self.find('connecting', scope=self.CONN_SCOPE, score=self.CONN_PRESCORE) is not None:
self.scene = Scene.CONNECTING
elif self.find('index_nav', thres=250, scope=((0, 0), (100+self.w//4, self.h//10))) is not None:
self.scene = Scene.INDEX
Expand Down Expand Up @@ -245,7 +247,7 @@ def get_scene(self) -> int:
def get_infra_scene(self) -> int:
if self.scene != Scene.UNDEFINED:
return self.scene
if self.find('connecting', scope=((self.w//2, self.h//10*8), (self.w//4*3, self.h)), score=0.2) is not None:
if self.find('connecting', scope=self.CONN_SCOPE, score=self.CONN_PRESCORE) is not None:
self.scene = Scene.CONNECTING
elif self.find('double_confirm') is not None:
if self.find('network_check') is not None:
Expand Down

0 comments on commit 920a7b7

Please sign in to comment.