mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-27 22:37:16 +08:00
Fix: Lower color threshold to 32 in PRICE_OCR
Add handler to delete wrong item results
This commit is contained in:
@@ -21,7 +21,7 @@ class AmountOcr(Digit):
|
|||||||
|
|
||||||
|
|
||||||
AMOUNT_OCR = AmountOcr([], threshold=96, name='Amount_ocr')
|
AMOUNT_OCR = AmountOcr([], threshold=96, name='Amount_ocr')
|
||||||
PRICE_OCR = Digit([], letter=(255, 223, 57), threshold=64, name='Price_ocr')
|
PRICE_OCR = Digit([], letter=(255, 223, 57), threshold=32, name='Price_ocr')
|
||||||
|
|
||||||
|
|
||||||
class Item:
|
class Item:
|
||||||
@@ -262,4 +262,11 @@ class ItemGrid:
|
|||||||
for item, p in zip(self.items, price_list):
|
for item, p in zip(self.items, price_list):
|
||||||
item.price = p
|
item.price = p
|
||||||
|
|
||||||
|
# Delete wrong results
|
||||||
|
items = [item for item in self.items if not (amount and item.amount <= 0) and not (price and item.price <= 0)]
|
||||||
|
diff = len(self.items) - len(items)
|
||||||
|
if diff > 0:
|
||||||
|
logger.warning(f'Ignore {diff} items, because amount <= 0 or price <= 0')
|
||||||
|
self.items = items
|
||||||
|
|
||||||
return self.items
|
return self.items
|
||||||
|
|||||||
Reference in New Issue
Block a user