mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-21 03:15:35 +08:00
Fix: Handle missing / in dorm food ocr
This commit is contained in:
@@ -30,6 +30,21 @@ class OcrDormFood(DigitCounter):
|
|||||||
image = cv2.multiply(image, 2)
|
image = cv2.multiply(image, 2)
|
||||||
return image
|
return image
|
||||||
|
|
||||||
|
def after_process(self, result):
|
||||||
|
result = super().after_process(result)
|
||||||
|
|
||||||
|
if '/' not in result:
|
||||||
|
for exp in range(40000, 90001, 1000):
|
||||||
|
res = re.match(rf'^(\d+){exp}$', result)
|
||||||
|
if res:
|
||||||
|
# 10005800 -> 1000/5800
|
||||||
|
new = f'{res.group(1)}/{exp}'
|
||||||
|
logger.info(f'OcrDormFood result {result} is revised to {new}')
|
||||||
|
result = new
|
||||||
|
break
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
OCR_FILL = OcrDormFood(OCR_DORM_FILL, name='OCR_DORM_FILL')
|
OCR_FILL = OcrDormFood(OCR_DORM_FILL, name='OCR_DORM_FILL')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user