Non-separable Transforms for Clustering Trajectories