From 9708ec05d762e31aba7209207717b7556191d1a8 Mon Sep 17 00:00:00 2001 From: YoursFunny Date: Mon, 6 Nov 2023 21:24:13 +0800 Subject: [PATCH] fix(cafe): use correct boarder method --- tasks/cafe/cafe.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasks/cafe/cafe.py b/tasks/cafe/cafe.py index e434095..d3dbfdf 100644 --- a/tasks/cafe/cafe.py +++ b/tasks/cafe/cafe.py @@ -71,7 +71,9 @@ class Cafe(UI): return [point for point in zip(*loc[::-1])] def _get_clickable_buttons(self, threshold=0.8, offset=(0, 0)): - image = cv2.copyMakeBorder(self.device.image, 20, 20, 10, 80, cv2.BORDER_CONSTANT, value=(0, 0, 0)) + image = self.device.image + h, w = image.shape[:2] + cv2.rectangle(image, (0, 10), (w - 25, h - 10), (0, 0, 0), 50) image = self._extract_clickable_from_image(image) points = self._match_clickable_points(image, threshold) points = self.merge_points(points)