-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compute speed and acceleration #298
base: master
Are you sure you want to change the base?
Conversation
This commit adds support for computing the speed and acceleration of the ball and the players from tracking data.
ece1477
to
2983c65
Compare
For savitzky-golay filter
3939cd8
to
aa6dd9b
Compare
Great work @probberechts! Do you think there would be any merit to adding a separate smoothing window size for smoothing the ball trajectory, instead of using the same window size for player and ball? |
@ussf-jbekkers I am not sure. Both the ball trajectory and player trajectories are measured using the same sensors, so I assume that they require the same filters. Yet, that assumption might be naive. Data providers might apply different post-processing to the ball and player trajectories. Also, I've never seen code or papers in which people applied different preprocessing to the ball and player trajectories. Do you have experience with applying different filters to the ball and player trajectories? If no one does this, I would not add 5 additional parameters. |
@probberechts I personally never considered this until I had a discussion with someone at Dagstuhl about this. His take was really simple, if you smooth the ball the same as you would player trajectories you will see a lot of those situations occur where the ball will "bend away" from a player when they make a pass (for example a one-touch pass) because the moment is pretty rapid and thus the sharp angle the ball would make in 4 or 5 frames will get smoothed so much that it looks like the ball floats away from the player. (I hope this makes sense verbally, I don't have visual example at hand). I understand not wanting to add it, especially because I also didn't consider it until quite recently and it seems like nobody has ever really cared, but it might at least be worth considering or preparing for by choosing parameter names that can be appended with additional/specific ball smoothing parameters without introducing breaking changes in the future. |
@ussf-jbekkers Yes, that makes sense. I'll add the option to smooth the ball trajectory differently. |
86ba41c
to
1da7a16
Compare
1da7a16
to
7c4fbc5
Compare
I came across this paper that seems interesting: https://journals.sagepub.com/doi/full/10.1177/17479541221124036 |
This PR adds support for computing the speed and acceleration of the ball and the players from tracking data. For example, the code below adds the speed, acceleration and distance covered by the ball and each player to each
Frame
.To be able to implement this efficiently for broadcast tracking data, I added the concept of a
Trajectory
which is a continuous track of the locations of a single player or the ball. A newTrajectory
starts every time a frame is missing or a player/ball is not tracked in a frame.I also had to change the interface of a
Frame
slightly. To be able to handle the ball data and player data uniformly, I renamed thePlayerData
class toDetection
(although I am not very happy with that name and suggestions for something better are welcome).I do not think that there are any agreed-upon guidelines on how to filter the data before computing kinematics and the best approach is probably data-dependent, so I've added support for a lot of options (see parameters of
compute_kinematics
). Any suggestions on what the default parameters should be?Once this is done, I should be able to finalize the event-tracking data synchronization.