deepof.utils.align_trajectories
- deepof.utils.align_trajectories(data: array, mode: str = 'all') array
Remove rotational variance on the trajectories.
Returns a numpy.array with the positions rotated in a way that the center (0 vector), and body part in the first column of data are aligned with the y-axis.
- Parameters:
data (numpy.ndarray) – 3D array containing positions of body parts over time, where shape is N (sliding window instances) * m (sliding window size) * l (features)
mode (string) – Specifies if all instances of each sliding window get aligned, or only the center
- Returns:
2D aligned positions over time.
- Return type:
aligned_trajs (np.ndarray)