From 4dfdcf42f53fb05918bdcff16bd917ffc094b74c Mon Sep 17 00:00:00 2001 From: YoursFunny Date: Mon, 6 Jul 2026 00:45:49 +0800 Subject: [PATCH] perf: reuse image array to improve memory performance --- module/base/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/base/base.py b/module/base/base.py index 5da4fab..a795875 100644 --- a/module/base/base.py +++ b/module/base/base.py @@ -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