A vision-based model of locomotion in crowded environments