The main method used is color and shape detection to discern the objects on the pool table. To each object, the program defines a different HSV filter. With the coordinates of each object, it calculates the likely path of the ball based on linear algebra. As the program can't estimate the exact location of the cue, thus creating many different possible outcomes, it also calculates which is the most likely path. The most likely path is shown during the shot.
It has been defined labels in front of the objects, to help me understand what the program was detecting during the development. Later on, I decided to keep them just for style.

Leave a Reply

Your email address will not be published.