1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-21 00:55:34 +08:00

Opt: Remove redundant converts from pillow to numpy

This commit is contained in:
LmeSzinc
2022-01-24 23:43:53 +08:00
parent c5ed59ab26
commit e92579b5f9
28 changed files with 62 additions and 64 deletions

View File

@@ -49,7 +49,7 @@ class RewardDorm(UI):
in: page_dorm
out: page_dorm, with info_bar
"""
image = MASK_DORM.apply(np.array(self.device.image))
image = MASK_DORM.apply(self.device.image)
loves = TEMPLATE_DORM_LOVE.match_multi(image, name='DORM_LOVE')
coins = TEMPLATE_DORM_COIN.match_multi(image, name='DORM_COIN')
logger.info(f'Dorm loves: {len(loves)}, Dorm coins: {len(coins)}')
@@ -178,7 +178,7 @@ class RewardDorm(UI):
return Digit(grids.buttons, letter=(255, 255, 255), threshold=128, name='OCR_DORM_FOOD')
def _dorm_has_food(self, button):
return np.min(rgb2gray(np.array(self.image_crop(button)))) < 127
return np.min(rgb2gray(self.image_crop(button))) < 127
def _dorm_feed_click(self, button, count):
"""