Create player_path_smoothing.py#3
Conversation
Just an example of trying to smooth out the noisy player radar positions arising from various errors in the homography and detections.
fenaux
left a comment
There was a problem hiding this comment.
Good, your python skill is better than mine ;)
About removing outliers. You eliminate the frame number. That is a coordinate can be an outlier an clothe to the path at an other time. I give an example of such a situation in the notebook. For the ball agglomerative clustering that allow to define a connectivity works better than dbscan. In addition distance_threshold in agglomerative clustering is the actual euclidian distance. The relationship between eps in DBSAN and the actual distance between points is not clear to me.
Savgol filter has not any physical background. So I prefer Kalman smoothing or frequency filtering
Note about acceleration :
y = np.diff(x) and z = np.diff(y)
then z[i] =y[i+1] - y[i]
z[i] = x[i+2] -x[i+1] - (x[i+1] - x[i])
z[i] = x[i+2] - 2*x[i+1] + x[i]
which is a very good approximation of second derivative at frame i+1 so index shift should be 1 and not 2
Just an example of trying to smooth out the noisy player radar positions arising from various errors in the homography and detections.
Please feel free to modify and improve, or ignore :)