cbaezp / roulette

This project is a proof of concept designed to explore the capabilities of computer vision in the context of object tracking :)
MIT License
2 stars 0 forks source link

Adapting code to my case #4

Open kadiraltug opened 1 month ago

kadiraltug commented 1 month ago

I want to work with my dataset and then train it and predict the result. How can I do this? Is there any progress about it? I added example video . Can you give me suggestion ? Have a nice day sir.

utils_output

cbaezp commented 4 weeks ago

I want to work with my dataset and then train it and predict the result. How can I do this? Is there any progress about it? I added example video . Can you give me suggestion ? Have a nice day sir.

utils_output utils_output

I suggest following a process similar to the one demonstrated in my video. Ideally, you should use a high-angle or aerial shot to visualize the entire scene as a matrix with x and y coordinates, especially if you plan to rely solely on computer vision without additional sensors. You will also need to establish a fixed point in your canvas coordinates to calculate the speed of the ball and the spinning roulette based on this fixed point.

For ball detection, you can train a model to recognize the specific object and plot its position in each frame. This will eventually give you the trajectory, i.e., if you have a 60fps video, you should have 60 different x,y coordinates for the ball for each second of your video. The same principle applies to the roulette itself. The easiest way to achieve this is by using the green slot, which can be detected using plain OpenCV without the need to train a model.

It's also possible to use OpenCV to detect the ball itself based on its shape and color without training a model. However, the efficiency of this technique may depend on the fps of your video.

Once you have pinpointed all the positions, you should be able to derive speed, trajectory, and potentially predict the landing zone. Of course, there are other variables you need to account for. This is just a general summary of my approach.

kadiraltug commented 4 weeks ago

Thanks for reply sir. Have you tried to continue developing the project later? Btw, I am recording the video from an online site. Because of this, it is very difficult to find video taken from an overhead camera.

kadiraltug commented 2 weeks ago

Hello sir, I calculated angular speed of the ball and whell. But I didnt predict real result. What is the problem? Do you have any idea?