mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2025-12-16 15:35:12 +00:00
fix(sweep): filter non-digit ocr text
This commit is contained in:
parent
30e8c8b21b
commit
e61afaf43b
@ -1,8 +1,9 @@
|
||||
from enum import Enum
|
||||
|
||||
from module.base.base import ModuleBase
|
||||
from module.base.timer import Timer
|
||||
from module.logger import logger
|
||||
from module.ocr.ocr import Digit
|
||||
from enum import Enum
|
||||
from tasks.stage.assets.assets_stage_sweep import *
|
||||
|
||||
|
||||
@ -123,7 +124,7 @@ class StageSweep:
|
||||
main.device.screenshot()
|
||||
if not timer.reached_and_reset():
|
||||
continue
|
||||
ocr_result = self.num.detect_and_ocr(main.device.image)
|
||||
ocr_result = list(filter(lambda x: x.ocr_text.isdigit(), self.num.detect_and_ocr(main.device.image)))
|
||||
if not ocr_result:
|
||||
logger.warning(f'No valid num in {self.num.name}')
|
||||
continue
|
||||
|
||||
Loading…
Reference in New Issue
Block a user