1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-11 23:18:22 +08:00

Refactor: Use numpy image cache instead of pillow image

This commit is contained in:
LmeSzinc
2022-01-23 15:50:15 +08:00
parent 6df7684a37
commit 65f166ad12
51 changed files with 286 additions and 228 deletions

View File

@@ -44,7 +44,7 @@ class Scroll:
Returns:
np.ndarray: Shape (n,), dtype bool.
"""
image = np.array(main.image_area(self.area))
image = np.array(main.image_crop(self.area))
image = color_similarity_2d(image, color=self.color)
mask = np.max(image, axis=1 if self.is_vertical else 0) > self.color_threshold
self.length = np.sum(mask)