mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 07:28:21 +08:00
Refactor: Use numpy image cache instead of pillow image
This commit is contained in:
@@ -18,7 +18,7 @@ class GuildLobby(GuildBase):
|
||||
Button: Button to enter guild report.
|
||||
"""
|
||||
# Find red color in the area of GUILD_REPORT_AVAILABLE
|
||||
image = color_similarity_2d(self.image_area(GUILD_REPORT_AVAILABLE), color=(255, 8, 8))
|
||||
image = color_similarity_2d(self.image_crop(GUILD_REPORT_AVAILABLE), color=(255, 8, 8))
|
||||
points = np.array(np.where(image > 221)).T[:, ::-1]
|
||||
if len(points):
|
||||
# The center of red dot
|
||||
|
||||
@@ -144,7 +144,7 @@ class GuildOperations(GuildBase):
|
||||
|
||||
list_expand = []
|
||||
list_enter = []
|
||||
dots = TEMPLATE_OPERATIONS_RED_DOT.match_multi(self.image_area(detection_area), threshold=5)
|
||||
dots = TEMPLATE_OPERATIONS_RED_DOT.match_multi(self.image_crop(detection_area), threshold=5)
|
||||
logger.info(f'Active operations found: {len(dots)}')
|
||||
for button in dots:
|
||||
button = button.move(vector=detection_area[:2])
|
||||
|
||||
Reference in New Issue
Block a user