How traffic lanes track vehicles

This page documents an earlier firmware release. Read this page for the latest release

A Qb2 with traffic lane zones detects every vehicle passing through the lane, measures its speed and size, and classifies it.

Each lane needs one traffic lane zone, and every frame passes through the same chain:

  1. Motion detection separates the moving points from the road.

  2. Detection groups the points inside the zone into clusters.

  3. Tracking follows each vehicle through the zone, frame by frame, and estimates its speed.

  4. Motion correction and aggregation. A fast vehicle is distorted because it moves while it is scanned; knowing its speed, the distortion is corrected. The points of every detection are then combined, so that even long vehicles are complete when they leave the zone.

  5. Classification assigns a class to each vehicle.

  6. Event. When a vehicle leaves the zone, an event reports it with class, speed, dimensions and its point cloud.

Animated plan view of a traffic lane zone
Figure 1. A vehicle passes the lane and is reported when it leaves
The traffic lane zone cannot be combined with security or volume zones on the same sensor.

Applications

A traffic lane suits flowing traffic on roads, highways and the approaches to intersections, where the vehicles drive towards the sensor. It is not meant for parked vehicles.

Vehicle counting

One event for each vehicle that leaves the lane, counted by lane, class or period.

Speed measurement

The speed of every vehicle, with vehicles marked that drive faster than the expected velocity of the lane.

Vehicle classification

The class of each vehicle in the 8+1 classification of the German TLS 2012 standard.

Vehicle dimension measurements

The length, width and height of each vehicle.

Intersections

The vehicles on each approaching lane, counted and classified.

Processing chain

Input

The zone works on the foreground point cloud: the points that motion detection has separated from the background, inside the box of the zone, expressed in the axes of the zone. The road surface, barriers and other static parts of the scene are background and do not reach the zone. Within the zone, the foreground points are clustered into objects, as described in Detection. Tracking, motion correction, aggregation and classification are done by the zone itself.

Tracking

For every frame, the zone performs these steps:

  1. Split clusters that hold more than one vehicle. A bicycle riding next to a car, or two bicycles riding closely behind each other, can end up in one cluster; each of them gets its own track.

  2. Predict the next position of every vehicle that is already tracked.

  3. Combine detected clusters that belong to the same vehicle. A truck and its trailer, for example, can show up as two clusters.

  4. Assign the tracked vehicles to the detected ones.

  5. Update the position and velocity of each vehicle, correct its distortion by applying motion correction and add its points to the aggregated point cloud.

  6. Start a new track for each vehicle seen for the first time. No track is started within the last 2 m of the zone.

  7. Delete the tracks of vehicles that have left the zone.

  8. Send out the current state of the lane, and an event for each vehicle that left.

The Expected Velocity of the zone is the speed a vehicle is assumed to have when its track starts. After that, the velocity is estimated from the positions of the vehicle in the following frames: first from the movement of its front. When the front nears the end of the zone and leaves it, the velocity is averaged over the movement of the rear of the vehicle, the part that is still inside the zone, in the last frames. Set the Expected Velocity to the usual speed at which vehicles drive inside the lane, see Set up traffic lanes.

A rain filter removes rain returns behind a vehicle, which would otherwise make it longer. It can cut vehicles short; it is on unless the API switches it off in every traffic lane zone.

Motion correction

A scanning LiDAR does not capture all points of a frame at the same moment. A vehicle at speed moves while it is scanned, so its points are smeared along the direction of travel. With the estimated velocity of the vehicle, each point is moved back to where it was at a common moment, and the vehicle gets its true shape again.

Vehicle point cloud smeared along the direction of travel
Figure 2. Motion distorted vehicle
Vehicle point cloud after motion correction
Figure 3. Motion corrected vehicle

Aggregation

As a vehicle drives through the zone and closer to the sensor, more and more parts of it become visible. For long vehicles such as trucks, buses or cars with trailers, not all parts are visible at the same time. Because the position of the vehicle is known in every frame, the detections of all frames are combined into one dense point cloud. Length, width and height are measured on this aggregated point cloud.

Classification

Each vehicle is assigned one class of the 8+1 vehicle classification of the German TLS 2012 standard.

Class TLS name

Motorbike

Krad

Car

Pkw

Car with trailer

PkwA

Van

Lfw

Truck

Lkw

Truck with trailer

LkwA

Semi-trailer truck

Sattel-Kfz

Bus

Bus

Other

nk Kfz

The classification has no class of its own for bicycles: a bicycle is reported as a motorbike.

The classification model, a support vector machine (SVM), assigns the class from features of the vehicle, such as its volume, intensity and point distribution. The sensor uses the default traffic model installed with the firmware. A model configured through the API replaces it. When the model is not confident enough about a vehicle, or the vehicle fits none of the eight classes, the vehicle is classified as Other. See Classification.

Output

Output What it holds When

State

The vehicles currently inside the zone, each with position, dimensions, velocity, point cloud and class.

Every frame

Event

One event for each vehicle that leaves the zone, with the UUID of the zone, the ID of the vehicle and its position, dimensions, velocity, aggregated point cloud and class.

When the vehicle leaves the zone

Vehicle positions are given in the local coordinate system of their zone, not in the coordinate system of the sensor, and the y-coordinate of a vehicle is its front, not its centre. In the API, the output of a traffic lane is State.TrafficLane and Event.Traffic.

In the Viewer, the tracked vehicles are drawn as blue boxes inside the lanes, and the event history lists each vehicle that left with its class, velocity, length and height. A velocity above the expected velocity of the lane is marked.

Perspective view of a traffic lane zone with a tracked vehicle drawn as a blue box, next to the event history with a truck, cars, a van and a motorbike at different speeds
Figure 4. A traffic lane with a tracked vehicle, and the vehicle events in the event history