CVZone Pool Shot Predictor contest
The steps taken are described:
- Find the table using HSV space
- Using contours, the pocket holes are found
- Cue ball and stick is found by contours too
- The target ball is found using HoughCircles
- A line is predicted from the stick along the cue ball to simulate the path of the cue ball, and is calculated a possible collision with the target ball
- If the collision is found, it calculates the target path as the line created from the cue ball towards the target ball (straight line passing the centers)
- On that target ball path is predicted the final position, if it reaches a pocket hole or not. In case of not reaching a pocket hole, its reflection is calculated to check if there is a new predicted final point
- The final prediction is drawn on the table, in green if it is IN or red if it is OUT
- Python 3.10
- OpenCV
- Numpy
python pool_shot_predictor.py