From dd97f5c4eca42f3893db22cf5c654d3a77319296 Mon Sep 17 00:00:00 2001 From: yiannisha Date: Wed, 24 Apr 2024 19:21:07 +0300 Subject: [PATCH] Change opening iterations value --- cv_bottle_detection/detector.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cv_bottle_detection/detector.py b/cv_bottle_detection/detector.py index 23fc8d3..620c206 100644 --- a/cv_bottle_detection/detector.py +++ b/cv_bottle_detection/detector.py @@ -182,7 +182,7 @@ def detect_package(self, img: np.array, _preproc: bool = True, _return_modified: gray = cv2.cvtColor(new_img, cv2.COLOR_BGR2GRAY) th, dst = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU) contours, hierarchy = cv2.findContours(dst, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) - + dv = self.padding['bottom'] - self.padding['top'] dh = self.padding['right'] - self.padding['left'] @@ -281,7 +281,7 @@ def detect_bottles(self, img: np.array, _preproc: bool = True, _return_bboxes=Fa # opening kernel = np.ones((3, 3), np.uint8) - dst = cv2.morphologyEx(dst, cv2.MORPH_OPEN, kernel, iterations=18) + dst = cv2.morphologyEx(dst, cv2.MORPH_OPEN, kernel, iterations=17) img = dst