Pedestrian counting in video sequences using optical flow clustering