Here's a video of the project:
Here is a diagram of the main components:
The system is comprised by a computer, a webcam and a video projector. The camera is placed on the ceiling, above the pool table. It's very important that the camera is positioned parallel to the ground, at the center of the table, so the captured image won't be distorted.
The projector is placed next to the camera. It won't be parallel to the table, but we can fix the projection distortion later, using either the projector own trapezoid corrections or even using homography.
The computer can be anywhere in the room, but it's easy if its near the camera. Some cameras doesn't work with long connection cables. The smaller the computer, the better to fix it on the ceiling. But I'm assuming a Raspberry Pi doesn't have the processing resources necessary for a smooth video processing.
The software running on the computer will get the camera image, detect the positions of all the balls on the table, detect the position and angle of the cue, calculate the game physics and draw the cue aiming on the screen, which will be projected on the table surface by the video projector
This software is based on the open-source (BSD) computer vision library OpenCV. There are parts of the code that rely on FMOD library for sound. FMOD is free for non-commercial uses, which is the case of this project. But these sound functions of Cassapa are not mandatory, and can be removed if you're not ok on using non-open-source code.
It is a nice game. I love play pool game. It is very fun and relaxed. Thanks for your sharing project. Good luck.