1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-04-02 11:54:09 +08:00

Pref: Reuse image array to improve memory performance

This commit is contained in:
LmeSzinc
2024-06-05 00:20:31 +08:00
parent 77d48937fc
commit 58202c6a40
34 changed files with 61 additions and 58 deletions

View File

@@ -29,7 +29,7 @@ class VoucherShop(ShopClerk, ShopStatus):
Returns:
np.array: [[x1, y1], [x2, y2]], location of the voucher icon upper-left corner.
"""
left_column = self.image_crop((305, 306, 1256, 646))
left_column = self.image_crop((305, 306, 1256, 646), copy=False)
vouchers = TEMPLATE_VOUCHER_ICON.match_multi(left_column, similarity=0.75, threshold=5)
vouchers = Points([(0., v.area[1]) for v in vouchers]).group(threshold=5)
logger.attr('Vouchers_icon', len(vouchers))