From c6c553692074c5350bc4f7b0c08296deea068745 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Tue, 20 Aug 2024 00:44:18 +0800 Subject: [PATCH] Fix: Add min distance to is_selected to nearing peaks --- tasks/item/inventory.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/item/inventory.py b/tasks/item/inventory.py index 2386c9cd8..6802d7863 100644 --- a/tasks/item/inventory.py +++ b/tasks/item/inventory.py @@ -52,6 +52,8 @@ class InventoryItem: image = color_similarity_2d(image, (255, 255, 255)) param = { 'height': 160, + # [ 10 110 114] + 'distance': 10, } hori = cv2.reduce(image, 1, cv2.REDUCE_AVG).flatten() peaks, _ = signal.find_peaks(hori, **param)