mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 03:58:22 +08:00
Pref: Reuse image array to improve memory performance
This commit is contained in:
@@ -271,7 +271,7 @@ class GridPredictor:
|
||||
|
||||
def predict_sea(self):
|
||||
area = area_pad((48, 48, 48 + 46, 48 + 46), pad=5)
|
||||
res = cv2.matchTemplate(ASSETS.tile_center_image, crop(self.image_homo, area=area), cv2.TM_CCOEFF_NORMED)
|
||||
res = cv2.matchTemplate(ASSETS.tile_center_image, crop(self.image_homo, area=area, copy=False), cv2.TM_CCOEFF_NORMED)
|
||||
_, sim, _, _ = cv2.minMaxLoc(res)
|
||||
if sim > 0.8:
|
||||
return True
|
||||
@@ -281,7 +281,7 @@ class GridPredictor:
|
||||
corner = [(5, 5, corner, corner), (tile - corner, 5, tile, corner), (5, tile - corner, corner, tile),
|
||||
(tile - corner, tile - corner, tile, tile)]
|
||||
for area, template in zip(corner[::-1], ASSETS.tile_corner_image_list[::-1]):
|
||||
res = cv2.matchTemplate(template, crop(self.image_homo, area=area), cv2.TM_CCOEFF_NORMED)
|
||||
res = cv2.matchTemplate(template, crop(self.image_homo, area=area, copy=False), cv2.TM_CCOEFF_NORMED)
|
||||
_, sim, _, _ = cv2.minMaxLoc(res)
|
||||
if sim > 0.8:
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user