Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

Motor-vehicle count and traffic-flow estimation from

traffic-camera imagery

Ala’a Al-Habashna

Data Exploration and Integration Lab (DEIL)


Centre for Special Business Projects (CSBP)
Statistics Canada

Delivering insight through data for a better Canada

World Urban Forum 11th session


June 29, 2022
Introduction
• The main goals of this project
➢ Develop a system for motor vehicle count extraction from static traffic-camera images using
computer vision
➢ Estimate traffic flow
• Real-time mobility flow statistics have many applications
• So far, the developed system is applied to multiple municipal and provincial traffic-
camera programs, and the results show clear traffic patterns
➢ Municipal: Calgary, Toronto, and Montreal
➢ Provincial: Ontario
• The method is scalable to more jurisdictions
Municipal traffic-camera program example: The city of Calgary

• Originally, a prototype system was


developed for the city of Calgary
• The traffic-camera program for the
city of Calgary has some advantages
➢Easy API access
Skyline of the city of Calgary
➢Consistent camera quality
➢Variety of city and highway scenes
➢High data refresh rate (1 min)
• Faces/license plates are not visible
Municipal traffic-camera program example: The city of Calgary
• The City of Calgary provides API access to 141 traffic cameras across the city
• The locations of some of the cameras are shown below

A map of Calgary traffic camera locations


Provincial traffic-camera program example: Province of Ontario

• Provided by the Ministry of


Transportation - Ontario (MTO)
• Dataset contains 1064 cameras
➢Overlap with Toronto is filtered
• Variable quality and refresh rate
Ontario’s 401 Highway
Other Traffic Cameras
• A survey has been completed for
estimates of municipal and provincial
traffic camera numbers
• A survey of potential sources indicated
approximately
➢ All provinces but none of the territories
have availability
➢7/10 of the most populated Canadian
municipalities have their own traffic
cameras program A traffic camera image from an Ontario highway
Overview of Process
• A workflow was developed to pull and analyze
images, and generate traffic count data
• This is done in 4 main steps:
1. Pull static images from the traffic cameras API
2. Run the object detection model on the images
3. Generate the count of motor vehicles in the image
4. Analyze the results

A traffic camera image taken from Calgary's


"16 Avenue / Home Rd NW“
Overview of methods: image processing
model
• Object detection is implemented using the
open-source You Only Look Once (YOLO) v3
computer vision model
• The model is trained on the Common Objects in
Context (COCO) dataset
• An image is fed to the model, which outputs a
bounding box around detected objects along
with predicted class of each object
• The model is able to detect and classify cars, Object detection on a static traffic image from
buses, motorcycles, and trucks Calgary’s "16 Avenue / Home Rd NW“
Output: Database of traffic-flow estimations
• The dataset generated by the
workflow contains the following
data:
➢Timestamp
➢Name
➢Location
➢Longitude, Latitude
➢Number of cars, trucks, buses, Object detection on a static traffic image from
Calgary’s "16 Avenue / Home Rd NW“
motorcycles, bicycles, and people
Example Predictions – Cars & Trucks
Estimates of hourly car traffic on a weekday,
all traffic cameras in Calgary
Estimates of hourly car traffic on a weekend
day, all traffic cameras in Calgary
Estimates of hourly car traffic on a weekday,
location-13 (downtown Calgary)
Estimates of daily traffic (all traffic cameras - cars)
Estimates of hourly car traffic on a weekday, location-8049
(downtown Toronto)
Estimates of daily car traffic, location-23-2 (Ontario highway)
Estimating traffic volume from static images
• We proposed methods to estimate traffic volumes (e.g., hourly, daily)
from the counts obtained from the static images

• Different methodologies were tested


➢Building models to directly estimate volume from traffic count
➢Using available historical data on street segments (e.g., Annual Average Daily
Traffic) with the obtained counts to estimate traffic volumes
Moving from R&D to a statistical program
• The R&D phase of this project demonstrated:
• Technical feasibility: weekly or higher frequency database of mobility flow is attainable
• Availability of open-source imagery: 10 Canadian cities (found so far) and all Canadian
Provinces have highway traffic-camera programs

• Currently, we are extending the work to a traffic-camera statistical program


• Weekly mobility flows for multiple metropolitan areas, and selected neighborhoods in
these cities (with counts of different types of vehicles and people)
• Weekly mobility flows for provincial highways
Dashboard for Geospatial Visualizations
• A dashboard has been developed to provide geospatial visualization of
the obtained results
Dashboard for Geospatial Visualizations (cont’d)
Dashboard for Geospatial Visualizations (cont’d)
Automation
• Developing pipelines to automate the whole process

Vehicle detection
Imagery Traffic volume
and count
acquisition estimation
estimation

Results Data analysis


visualization
Relevance and applications of these statistics
• Real-time mobility-flow statistics have intrinsic relevance and can become
a new product in a statistical program
• Research has shown that road traffic is highly correlated to the level of
economic activity
• Real-time mobility-flow statistics can be used as input in local and macro-
economic modeling and analysis
• Tourism and transportation program can use this information to
supplement existing data sources on mobility
Thank you!
alaa.al-habashna@statcan.gc.ca

You might also like