-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Ball detection #12
base: master
Are you sure you want to change the base?
Ball detection #12
Conversation
Add test images and file to test HoughCircles
Add code that uses hough circles to detect balls
@@ -2,15 +2,18 @@ | |||
import cv2 as cv | |||
|
|||
|
|||
vidcap = cv.VideoCapture('test_photos_balls/yellowcheck.mp4') | |||
#vidcap = cv.VideoCapture('test_photos_balls/yellowcheck.mp4') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get the ball detection stuff wrapped in the correct classes from the beginning.
@@ -19,6 +22,9 @@ | |||
|
|||
|
|||
mask = cv.inRange(hsv, low_yellow, high_yellow) | |||
mask = cv.erode(mask,None, iterations=7) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain what this is accomplishing?
@@ -30,7 +36,7 @@ | |||
|
|||
th2 = cv.adaptiveThreshold(output[:,:,2], 255,cv.ADAPTIVE_THRESH_GAUSSIAN_C, cv.THRESH_BINARY,15,10) | |||
|
|||
circles = cv.HoughCircles(th2, cv.HOUGH_GRADIENT, 1.8, 20, param1=70, param2=50, minRadius=20, maxRadius=60) | |||
circles = cv.HoughCircles(th2, cv.HOUGH_GRADIENT, 1.8, 40, param1=70, param2=50, minRadius=20, maxRadius=60) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get a comment describing what all these parameters are doing.
Do you have an example of how to run this? |
Improved ball detection using erode and dilate methods