From 4bc5e558aa0288223825130a9391cccb218a843a Mon Sep 17 00:00:00 2001 From: Nathan Beaud Date: Tue, 5 Mar 2024 14:59:36 +0100 Subject: [PATCH] Fixing detection from higher distance --- redball_detection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redball_detection.py b/redball_detection.py index b395479..c17f925 100644 --- a/redball_detection.py +++ b/redball_detection.py @@ -31,7 +31,7 @@ def find_red_ball(image): for contour in contours: (x, y), radius = cv2.minEnclosingCircle(contour) - if radius > 10 and is_circular(contour, radius): # Checks size and circularity + if radius > 5 and is_circular(contour, radius): # Checks size and circularity center = (int(x), int(y)) # Draw the circle around the detected ball cv2.circle(image, center, int(radius), (0, 255, 0), 2)