Fixing detection from higher distance

This commit is contained in:
Nathan BEAUD 2024-03-05 14:59:36 +01:00
parent 5330749958
commit 4bc5e558aa
1 changed files with 1 additions and 1 deletions

View File

@ -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)