mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 09:48:20 +08:00
Refactor: Use numpy image cache instead of pillow image
This commit is contained in:
@@ -184,7 +184,7 @@ class CampaignOcr(ModuleBase):
|
||||
self.stage_entrance: dict. Key, str, stage name. Value, Button, button to enter stage.
|
||||
|
||||
Args:
|
||||
image (PIL.Image.Image):
|
||||
image (np.ndarray):
|
||||
"""
|
||||
self.stage_entrance = {}
|
||||
buttons = self.campaign_extract_name_image(image)
|
||||
|
||||
@@ -162,7 +162,7 @@ class GemsFarming(CampaignRun, Dock, EquipmentChange):
|
||||
list_level = ocr.ocr(self.device.image)
|
||||
|
||||
for button, level in zip(card_grids.buttons, list_level):
|
||||
if level == 1 and template.match(self.device.image.crop(button.area), similarity=SIM_VALUE):
|
||||
if level == 1 and template.match(self.image_crop(button), similarity=SIM_VALUE):
|
||||
return button
|
||||
|
||||
logger.info('No specific CV was found, try reversed order.')
|
||||
@@ -171,7 +171,7 @@ class GemsFarming(CampaignRun, Dock, EquipmentChange):
|
||||
list_level = ocr.ocr(self.device.image)
|
||||
|
||||
for button, level in zip(card_grids.buttons, list_level):
|
||||
if level == 1 and template.match(self.device.image.crop(button.area), similarity=SIM_VALUE):
|
||||
if level == 1 and template.match(self.image_crop(button), similarity=SIM_VALUE):
|
||||
return button
|
||||
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user