Hough Circle Transformations works. It detects circles, but it does not detect all circles. It also has a tendency to detect the wrong size of the circle based on light reflections.
Testing pictures of the pool table with scattered pool balls were fed to the program. Five 1080p still images were captured each had 10 balls on the table, the detections were not good 1, 1, 3, 2, and 1. The prebuilt library is not accurate enough.
Hough Line Transformations works. It is more accurate when detecting the difference between the ball and the cloth. In some cases it detects the line of the shadow under the cushion. It struggles to detect the circular shape on darker shaded balls. On brightly shaded balls the circle imprint has potential for further processing. Examples of brightly shaded are the yellow 1, orange 5 and white striped 9 ball. The red 3 had a cast shadow and the detection was incomplete.
OpenCV is a good start, but you have to know how to optimize the code. If anyone is interested it is demanding in terms of Quality Testing and development moves at a snail pace.
Developing alternative solutions to improve the existing code base is ongoing. Strong geometers with programming skills are wanted.
docs.opencv.org