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

Opt: Improve memory performance in map detection

This commit is contained in:
LmeSzinc
2024-04-30 17:23:23 +08:00
parent 44c4ccc240
commit 58922cccb8
3 changed files with 24 additions and 16 deletions

View File

@@ -168,8 +168,9 @@ class Perspective:
Returns:
np.ndarray
"""
image = rgb2gray(crop(image, self.config.DETECTING_AREA))
image = cv2.subtract(255, cv2.bitwise_and(image, ASSETS.ui_mask))
image = rgb2gray(crop(image, self.config.DETECTING_AREA, copy=False))
cv2.bitwise_and(image, ASSETS.ui_mask, dst=image)
cv2.subtract(255, image, dst=image)
return image
@staticmethod