Trajectory-based motion pattern analysis of crowds