Browse Source

fix(RichMan): OCR recognition error.

ryland 2 years ago
parent
commit
f6ddf05b83
2 changed files with 2 additions and 2 deletions
  1. 1 1
      tasks/RichMan/mall/medal.py
  2. 1 1
      tasks/RichMan/mall/special.py

+ 1 - 1
tasks/RichMan/mall/medal.py

@@ -67,7 +67,7 @@ if __name__ == '__main__':
     from module.config.config import Config
     from module.config.config import Config
     from module.device.device import Device
     from module.device.device import Device
 
 
-    c = Config('test')
+    c = Config('oas1')
     d = Device(c)
     d = Device(c)
     t = Medal(c, d)
     t = Medal(c, d)
 
 

+ 1 - 1
tasks/RichMan/mall/special.py

@@ -161,7 +161,7 @@ class Special(Buy, MallNavbar):
         # logger.info(f'上中点是:{upper_midpoint}')
         # logger.info(f'上中点是:{upper_midpoint}')
         # logger.info(f'数字的ROI是: {self.O_SP_RES_NUMBER.roi}')
         # logger.info(f'数字的ROI是: {self.O_SP_RES_NUMBER.roi}')
         result = self.O_SP_RES_NUMBER.ocr(self.device.image)
         result = self.O_SP_RES_NUMBER.ocr(self.device.image)
-        result = result.replace('?', '2').replace('?', '2').replace(':', ';')
+        result = result.replace('?', '2').replace('?', '2').replace(':', ';').replace('火', '次').replace('教', '数')
         try:
         try:
             if ':' in result:
             if ':' in result:
                 result = re.findall(r'剩余购买次数:(\d+)', result)[0]
                 result = re.findall(r'剩余购买次数:(\d+)', result)[0]