I am working on a project to build software for giving recommendation to referee. One of the recommendation is to give throw in to the team if ball goes out of the field. I have following information
- Coordinates of the ball at every time instant and field dimensions which can be used to detect whether ball is inside or outside the pitch
- Coordinates of robots at every time instant which can also be used for detecting velocity of robots
these measurements are noisy, is there any way to determine which team's player touched the ball last when it goes out of the field?
I would try with the follwing approach. Every time the ball exits from the field:
Take all points that define the position of the ball in the last $s$ seconds, for an appropriate $s \in \mathbb{R}^{+}$.
Determine the ball trajectory as a union of segments. The idea is that the ball moves rectilinearly if not touched, otherwise it changes the segment when touched by a player. For determining segments I suggest to use iteratively RANSAC algorithm on the points selected at previous point.
Once you have the trajectory of the ball in the last $s$ seconds, determine the last segment, i.e., the one that is not completely contained inside the field.
Determine also the penultimate segment, and use it to determine the point of intersection of the two segments, i.e., the point in which the ball was touched for the last time before exiting.
By linear interpolation you should be able to determine also the time $t$ in which the ball was touched for the last time before exiting.
Assuming the players as punctiform, determine the player that touched the ball for the last time before exiting by looking at the positions of the players at time $t$ and taking the nearest one.