I managed to track cue ball path! OpenCV

Pubo

Active member
Hi all, 6months ago I posted a question about tracking the billiard ball using software, like the one they do on kozoom


Before I tried to achieve this by using optical flow method in OpenCV, but this is not robust and I need a bright reflection on the surface of the ball, which is not there most of the time. If you are interested you can check my old post https://forums.azbilliards.com/thre...ctories-of-pool-balls-in-a-video-clip.552749/

Now I can track relatively well the balls in a video downloaded from YouTube, for example this one

The basic idea is to sample the HSV range of a couple of (10) points on the ball you wish to track, use this information to convert each frame into a black and white picture, then finding the white contour with the largest area, and voila!
 
Hi all, 6months ago I posted a question about tracking the billiard ball using software, like the one they do on kozoom


Before I tried to achieve this by using optical flow method in OpenCV, but this is not robust and I need a bright reflection on the surface of the ball, which is not there most of the time. If you are interested you can check my old post https://forums.azbilliards.com/thre...ctories-of-pool-balls-in-a-video-clip.552749/

Now I can track relatively well the balls in a video downloaded from YouTube, for example this one

The basic idea is to sample the HSV range of a couple of (10) points on the ball you wish to track, use this information to convert each frame into a black and white picture, then finding the white contour with the largest area, and voila!

Can you estimate ball speed as well?
 
Nice work. Any other goals with this project?

FYI, I don't think the HSV method will work for the stripe balls.
You are right, for stripes it's much trickier. I don't yet know how to do it with stripes. I heard that you need to do it with ML. On the other hand, now the most popular game is 9-ball, I get away with it haha
 
Should be doable, right? Since we know the framerate of the video and the dimensions of the table. I haven't given it much of a thought yet.
I tried this exact same thing with OpenCV, but I failed.

You did a much better job than I did.

Initial cue ball speed is what I am after. Please let me know if you can achieve this.

I threw away the idea of doing this with a low quality web cam (i.e. customer setup). Looks like you need a fixed camera with good lighting.
 
I tried this exact same thing with OpenCV, but I failed.

You did a much better job than I did.

Initial cue ball speed is what I am after. Please let me know if you can achieve this.

I threw away the idea of doing this with a low quality web cam (i.e. customer setup). Looks like you need a fixed camera with good lighting.
Actually I think a 1080p web cam might be enough? The low res might even help smooth out the dots on the ball, making it more homogeneous and thus easier to track. I'll have to try this. I'll let you know.
 
I tried this exact same thing with OpenCV, but I failed.

You did a much better job than I did.

Initial cue ball speed is what I am after. Please let me know if you can achieve this.

I threw away the idea of doing this with a low quality web cam (i.e. customer setup). Looks like you need a fixed camera with good lighting.

I do think you need a fixed camera position for the speeds and angles like PerformStars gets. They require one static camera on submitted videos. I suspect they define the table dimensions at the start of the analysis process, similar to what you did in one of your YouTube videos.
 
Would be cool to see how balls disperse in breaks. Layer 100 breaks and see if a pattern emerges?

Cool stuff. Maybe DrDave can help? Not sure if he is techsavvy in this matter.
 
What is the difference between what you are trying to do and high speed photography? I believe life magazine had a story on this in the 30s?
 
What is the difference between what you are trying to do and high speed photography? I believe life magazine had a story on this in the 30s?
Sorry I don't quite understand your question.:unsure: But path drawing has nothing to do with high-speed photography.
 
Would be cool to see how balls disperse in breaks. Layer 100 breaks and see if a pattern emerges?

Cool stuff. Maybe DrDave can help? Not sure if he is techsavvy in this matter.
actually there are patterns, and Dr.Dave talked about it before
 
Back
Top