Measurement of congestion and risk in pedestrian crowds