Pool Shot Predictor

Sponsored by Nvidia

Contest is finished!
Previous videoNext video
Title: Pool Shot Predictor
Author: Dhaval
Votes: 187

Views: 1467
Description: The outcome of a shot in the game of pool based on a video of the game. The code is loads a video file and processes each frame to detect the position of the pool balls and the edges of the pool table. It then predicts the path of the cue ball and determines whether the shot will result in the ball being pocketed or not. The code uses OpenCV library to perform computer vision tasks such as edge detection, Hough transform, and morphological operations. It also defines functions to calculate the intersection of a movement direction with a rectangle and to predict whether the ball will be pocketed or not. The code first resizes the video window, applies a green color threshold to the frame to detect the pool table, and uses morphological operations to remove small objects from the image. It then applies Hough transform to detect lines in the image and identify the edges of the pool table. The code then extracts the position of the balls from the frame using a similar process of applying color thresholds and morphological operations. It tracks the position of the cue ball and predicts its path using a physics-based model. Finally, the code predicts whether the shot will result in the ball being pocketed or not based on the location of the pockets and the predicted path of the ball. The result is displayed as text on the screen along with a green or red color indicating whether the shot is predicted to be successful or not. The script also saves the processed video file as a new file.