Stationary pool ball detection in Grayscale Image

I want to detect the pool balls when they are not moving. While moving I can detect them with any background subtraction model, finding a hard time detecting them while stationary.


Normal thresholding won’t work. Worked on the gradient of the image but it is difficult to remove noise completely. Also used DFT but no results.

wrong camera. is this infrared?

you have no contrast between balls and background. and the resolution…

get a camera that gives you this contrast. normal color would be worth a try.

It is infrared. We are using this as there is also a projection on the pool table to make it interactive. So IR images will not be affected by changing artificial lights and projections.

old post but it should work object detection in nonuniform illumination - OpenCV Q&A Forum

Thank you @laurent.berger. I will try to implement it and see the results.


@crackwitz never got a solution to the problem.

What do you mean? Can you elaborate?

ah, you wrote the same thing on SO too. yes, I understand that your old questions weren’t resolved. I am linking them here because they contain important context/information, also any previously given suggestions that may have helped or not helped.

1 Like

Sorry for the cross-post since I am not aware of community guidelines, I am still new to these. I thought posting on both platforms would give me a better reach.

Seems like the thresholding is not working because the background reflection is not uniform. I would spend some time with correcting the background reflection using different methods.

Thank you @Ziri Can you suggest some method? I have tried CLAHE, but its still difficult to threshold.