A computer vision system for detecting and analysing critical events in cities