perf: reuse image array to improve memory performance

This commit is contained in:
2026-07-06 22:40:29 +08:00
parent 5168e4edf0
commit 4dfdcf42f5
+1 -1
View File
@@ -281,7 +281,7 @@ class ModuleBase:
Returns:
Button: Or None if nothing matched.
"""
image = color_similarity_2d(self.image_crop(area), color=color)
image = color_similarity_2d(self.image_crop(area, copy=False), color=color)
points = np.array(np.where(image > color_threshold)).T[:, ::-1]
if points.shape[0] < encourage ** 2:
# Not having enough pixels to match