A Generic Framework for Clustering Vehicle Motion Trajectories