Rule-based reasoning on visual data for urban traffic monitoring