A single-scan algorithm for connected components labelling in a traffic monitoring application