mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-15 15:47:42 +08:00
Refactor: Use numpy image cache instead of pillow image
This commit is contained in:
@@ -31,7 +31,7 @@ class EquipmentChange(Equipment):
|
||||
index = 0
|
||||
self.equipping_list = []
|
||||
for button in EQUIPMENT_GRID.buttons:
|
||||
crop_image = np.array(self.device.image.crop(button.area))
|
||||
crop_image = np.array(self.image_crop(button))
|
||||
edge_value = abs(np.mean(cv2.Sobel(crop_image, 3, 1, 1)))
|
||||
if edge_value > 0.1:
|
||||
self.equipping_list.append(index)
|
||||
@@ -57,7 +57,7 @@ class EquipmentChange(Equipment):
|
||||
self.ui_click(click_button=UPGRADE_ENTER,
|
||||
check_button=UPGRADE_ENTER_CHECK, skip_first_screenshot=True)
|
||||
logger.info('Save equipment tamplate')
|
||||
self.equip_list[index] = self.image_area(EQUIP_SAVE)
|
||||
self.equip_list[index] = self.image_crop(EQUIP_SAVE)
|
||||
logger.info('Quit upgrade inform')
|
||||
self.ui_click(
|
||||
click_button=UPGRADE_QUIT, check_button=EQUIPMENT_OPEN, appear_button=UPGRADE_ENTER_CHECK,
|
||||
|
||||
Reference in New Issue
Block a user