# Analyzing Traffic Speed From a Single Night Image - Light Streaks Detection

## Part 1: project profile

### Project name

Analyzing Traffic Speed From a Single Night Image - Light Streaks Detection

### Project short description

When you shot a night photo of a road, you will notice that car’s lights are often the most relevant thing of the photo. Then, if you use a longer exposure time, lights will leave amazing streaks or “trails” in the image, which are really the image of the car’s lights trajectory during the exposure. So, starting from a photo of a street, possibly busy, the aim is that of trying to compute the approximate speed of every car that is running along the road.

An example of a long exposure photo.

### Dates

Start date: 2008/04/28

End date: 2008/06/16

### People involved

Alessandro Giusti - User:AlessandroGiusti

Giacomo Boracchi - User:GiacomoBoracchi

##### Students currently working on the project

Stefano Magni - as a project for the course Computer Vision (Como), prof. Caglioti

Christian Malecore - as a project for the course Computer Vision (Como), prof. Caglioti

##### Students who worked on the project in the past

Matteo Albinola - User:MatteoAlbinola - as a project for the course Image Analysis and Synthesis, prof. Caglioti

Matteo Carcano - User:MatteoCarcano - as a project for the course Image Analysis and Synthesis, prof. Caglioti

## Part 2: project description

### The Problem

The problem is to find a method in orderd to approximatively estimate the speed of every car, starting from their light streaks left in a long exposure photo.

### Preliminary Studies and Sketches

The first part of this work is centered on a preliminary analysis of this scenario that allowed to define a very important set of assumptions on the features that a night long esposure photo must satisfy, and also a set of constraints related to the environment. Then, a deeper analysis shows a possible problem decomposition into three sub problems:

• Identification of all light streaks left by the car
• Approximative estimation of the speed
• Clustering compatible streaks in order to identify cars that are really lying on the road

### Solution

The solution merges different techniques from image analysis and others from image geometry.

The first sub problem is treated using two different approaches, one based on a technique for estimating the blur extent (very similar to a long streak), and consequently streak’s extremes, with the application of autocorrelation function (ACF) and the other that try to reach same results but using the Hough transform. Last two sub problems are solved instead with knowledge about image geometry, so working on relations between lines, angles and cross-ratios (alternatively homography).

### Description and Results of Experiments

There are two different categories of images belonging to dataset:

• Photo of cars with known speed
• Photo of cars with unknown speed (traffic photos)

The first category is mainly used to test quality and robustness of the speed estimation. This is an example result:

 An example of photo with a known car speed (Car speed: 37Km/h, Exposure time: 2s) Result of car speed estimation (Estimated speed: 38.56Km/h, Car speed: 37Km/h, Exposure time: 2s)

The second category is especially used to test the quality of the streaks detection and car clustering on a busy road. This is an example result:

 An example of photo with an unknown car speed (Exposure time: 1s) Result of car detection and clustering (Exposure time: 1s)

Main problems revealed by the testing are:

• Overestimation of cars speed
• Wrong car detection for non parallel streaks trajectories

From the experimental results, we notice also a set of important things that must be taken into account:

• Photo quality - the background of the photo must be dark exept in correspondence of the light streaks
• Exposure time - important is to find the right tradeoff between a shorter and longer time