Clustering of Motion Trajectories by a Distance Measure Based on Semantic Features