Using computer vision as a tool in the roads

Our solution detects, tracks and monitors the velocity of cars in a road in order to prevent any possible accidents or any exceeded speed limitations.

Banner image source: http://bsnscb.com
Image source: http://www.walldevil.com

The goal of our system is to improve the safety of different roads anywhere in the world, where speeding causes thousands of deaths every year. We have developed a prototype system in Matlab that allows us to detect, track and estimate the velocity of cars within a road. Other measures we can provide are:

  • The current density of the road (low, medium or high)
  • The number of cars in each lane
  • Instant photos of cars which surpass speed limitation

Vehicle detection

  • Performing a background/foreground segmentation of every frame in the video we are able to separate moving cars from static road background.
  • Background is modeled with a single adaptive Gaussian model per pixel.
  • This block outputs a binary segmented image, refined with morphological operators to eliminate noise and fix disconnected regions.

Vehicle tracking

  • To obtain a correct road geometry homography is applied to the segmented and original images.
  • After detecting blobs in the refined binary segmented image, Kalman filters are applied to track the cars.
  • A cost function is defined to decide whether a detection is part of a previous tracked car or not.

Speed control

  • Defining a relation between pixels/meters and frames/seconds, speed can be estimated following the tracked car coordinates.
  • An ID and the speed of each car is presented in the final system, together with a bounding box following the car

Statistical report

The final statistics we can obtain are:

  • Density of the road at each frame
  • Number of cars in each lane at each frame
  • Total number of cars in a sequence
  • Total number and the images of cars which have exceeded the speed limit

Our results on ChangeDetection Video Database

Toy examples with a highway and a jitter sequence

Our results on a recorded video


The video has been recorded in Barcelona during the day

Contact us