M4 - Video Analysis - Team 2
Video Surveillance for Road Traffic Monitoring
Laura Pérez Mayos
María Cristina Bustos
Xián López Álvarez
Gonzalo Benito
Project Goal
The main objective is to develop a Video Surveillance System for Traffic Monitoring with the capability of:
Pipeline of the process
Video input
Video to sequence
Video Stabilization
Foreground Segmentation
Object Tracking
Speed estimation
Vehicle counting
Video Surveillance System for Traffic Monitoring Algorithm
Sequence analysis
Once the input video is recorded, the sequence is split into frames and stored apart.
The system was developed and tested using 3 different video sequences: two of them as toy sequences for testing and tune-up, and one sequence of our own for final testing.
highway
traffic
Parc Nova Icaria
Video stabilization
To be able to work with the videos extracted from traffic cameras we first have to remove the effect of camera motion from a video stream.
→ improve background estimation and foreground segmentation
→ improve object tracking
Two Techniques explored:
Displacement between two consecutive frames in the traffic sequence used for testing.��Source: MCV 2016 team 1
Video stabilization: Optical Flow Approach
In order to do video stabilization, optical flow is calculated using Block Matching approach. Block Matching consists in taking a block in one image and looking for the most similar block in other imagen in a certain search area
For Traffic sequence, Block Matching is only calculated in one part of the image, where there is an immovable object. The mean of the optical flow is taken for stabilize the video
Image 1
Mean of optical flow in image 2
Target Tracking Video stabilization
Note: we added a black padding to all the frames to deal with the lose of information in the borders of the frames after stabilization, and we applied the same stabilization and padding to the ground truth.
Main idea: use a block-based parametric motion model to correct translational and rotational camera motions.
source: https://es.mathworks.com/help/vision/examples/video-stabilization.html
Background Estimation
Gaussian Model: A pixel is defined as background or foreground depending on a gaussian distribution
if
then background
else
foreground
Adaptive Gaussian: Train the background with a initial part of the video, and then update the gaussian recursively
if background
μ and σ matrices for highway sequence
Source: M4 Video Analysis Lecture 2
Source: MCV 2016 team 6
Background Estimation & Foreground Segmentation
Stauffer & Grimson: Based on Gaussian Mixture Model (GMM).
Source: M4 Video Analysis Lecture 2
Background Estimation Improvements
In order to improve the masks generated by Stauffer & Grimson and make the tracking easier we apply a series of morphological filters:
Bg mask
Closing
(dilation + erosion)
Opening
(erosion + dilation)
Fill holes
bwareaopen
(remove small objects)
Morphological Operator Pipeline
Tracking
In the tracking framework, we have two kind of variables:
The idea is, first, to predict the current state of the object based only on the previous measurements:
Then, we will make an update once we have the new measurement:
Image from 4th lesson of M4, MCV. Professor Ramon Morros.
Tracking: Kalman filter
Image from 4th lesson of M4, MCV. Professor Ramon Morros.
Optimal method in the case of a Linear Dynamics Model with Gaussian noise.
LDM equations:
Tracking: Other Techniques
Mean Shift:
Particle Filter:
Further tracking techniques were explored.
Particle filter approach works quite well.
Mean shift approach is in need of further tune up.
Vehicle Counting
When counting vehicles, we have to discard some tracks, since they do not correspond to real vehicles.
Putting a threshold on the lifespan of tracks solved this problem in our case.
Source: difoosion.com
Speed control
We measured the distance between two consecutive street lamps (24 m).
Since we have a frontal view of the road, it was enough with drawing two horizontal lines crossing the lamps.
We record the moment on which the bottom left corner of a track passes each mark.
Knowing that our camera has a rate of 30 frames per second, the speed follows immediately.
Speed control: results on toy sequences
For the toy sequences we need to make some strong assumptions in order to proceed with speed estimation:
Speed control: results on toy sequences
Vehicle | Speed (km/h) |
1 | 50 |
2 | 84 |
3 | 76 |
Vehicle | Speed (km/h) |
1 | - |
2 | 89 |
3 | 89 |
4 | 86 |
5 | 81 |
6 | 81 |
Highway
Traffic
Speed control: results on our sequence
All the cars in our sequence were under the speed limit.
Video Surveillance System for Road Traffic Monitoring
Conclusions
Thank you! Questions?
More information available at our web: goo.gl/D4ZJnw
Gonzalo Benito
gonzabenito@gmail.com
María Cristina Bustos
mcb9216@gmail.com
Xián López
lopezalvarez.xian@gmail.com
Laura Pérez
lpmayos@gmail.com