I am currently working on a project where I need to be able to reliably get the position of the balls in the pool table.
I am using Kinect v2 over a table as a source.
The original image looks like this (after converting it to 8-bit from 16-bit, discarding pixels that are not around the table level):

Then I subtract the reference image with an empty table from the current image.
After the threshold and alignment, it looks like this: image

It is quite easy to detect individual balls in one image, the problem is that I have to do this constantly at a frequency of 30 frames per second.
Difficulties:
- Image with low resolution (512 * 424), a ball about 4-5 pixels in diameter.
- Kinect (2 ).
- - , , .
- , , ( ),
- , , , : , ..
, , :
, , , . , . ( , Kinect , )
.