There will be big infrastructure works in my part of Brussels.
The government is trying to measure the impact of deviations and road blocks on traffic.
They also try to assess if the currently being built metro line M3 has a positive impact on traffic.
The department of public works has contacted a company that's specialised in getting traffic metrics. They put a counting device in private house's windows.
They were looking for volunteers to install such a traffic counter.
I subscribed and just got a device. It's a Raspberry Pi with a low definition camera!
image source: extension of metro line 3, and my house marked in red
The Traffic Counter
The company and device are called telraam (abacus).
It's a play on words. In Dutch, Tel-Raam is literally Count-Window.
I received it yesterday. Look what's inside:
Inside the black box: a Pi 3 A+
The camera is a Pi CAM V2
The firmware is pre-loaded on an SD card. As a user, you don't interact with the Pi directly. The setup is typically done via browsers.
I may blog later on how the setup and provisioning works. Long story short: it was an easy 6 step process. Can be done by anyone that is able to follow instructions.
This can be a good example for parties that want to build a consumer product on a Pi, for a non-tech audience.
The Data
Filming a street is a sensitive subject. Privacy comes into play.
For that reason, the raw video data is never streamed. It doesn't go beyond the Pi.
Counting the different types of traffic, the direction, and the speed, are derived from the camera stream.
That data is then regularly exchanged with the Telraam online services.
Virtually everything happens on the Pi:
- detect if a moving object is traffic
- categorise it (pedestrian, bike, car, heavy)
- determine direction
- determine speed
That telemetry data is sent to the cloud.
Two times per day, the camera also takes a real image of the street and sends that to the server. This is done to validate that the camera is positioned correctly.
To ensure that the data does not include privacy sensitive info, these measures are in place:
- 30 seconds of video are recorded, then all pixels are averaged to make any moving object unrecognisable
- the resolution is reduced by using pixelisation. This takes care that people and license plates never show up.
- these images are stored for 8 days maximum, and can only be viewed by support and the person that owns the counter (me).
The design is reviewed by the Belgian privacy commission.
The abstracted data is free for anyone that wants to use it for academical use or public-related causes. There's an API.
That data does not include my exact location (it shows the section of the street I am in), or any images.
The counter does not work during the night. That would require a much more expensive setup.
Private Interface
As the owner of the traffic counter, I have access to an owner's dashboard.
This interface is used to finetune what's covered by the camera:
- street layout (size, lanes, ...)
- what side of the street the camera is on
- type of traffic
- the low-resolution, blurred camera image to validate it still points at the desired area.
- data insights, but they are virtually identical to what the public sees.
The only difference is when there are more than one camera on a street section. In that case, I can see my individual camera's results.
Other data consumers (government and the general public) will get the averaged results of all cameras on that street section.
Public Interface
The public will be able to look at a map, and see what street sections are covered by one of more counters.
They can then drill into the data and trends.
You can monitor with me.
Here's what's available for my counter. It's in use for half a day now:
image: the section of the street that I am monitoring
image: last hour's count. Heavy vehicles and speed need more time for calibration
image: more data: the count after half a day. You can set the time window - but mine is just active since this noon.
Speed data is also public. Not per vehicle (nothing can be traced back to individual cars), but amount divided into buckets.
My street, like most roads in Brussels, has a 30 KM/H limit.
image: speed buckets
The few ticks in the higher speed buckets (50+) are very likely glitches in the recognition. This was mentioned during the intro session.
The counts there are too low to represent valid data.
image: analysis of the expected feasible speed per hour in my street.
image: does the traffic move in or out of town, per hour?
Last one shows the different types of traffic, and their percentages.
Note that there are virtually no trucks and pedestrians:
- From my location, I can't count pedestrians because the house is too close to the street and it can't capture the sidewalks
- Counting trucks needs approximately 3 weeks of data, so that the system can calibrate itself.
This is camera position dependent, and can't be preconfigured with reliable outcome. That's why the first weeks are used to learn.
Government Interface
The government has access to all data the public has, but they get additional analysis tools for the area to hire the service for.
These show how traffic's behaviour changes over time. That can be morning vs evening, winter vs summer, week vs weekend, before, during and after infrastructure works, ...
Those are the tools they use to turn this raw individual citizen window counters into tools to make decisions.
related blog |
Counting Traffic for the Community - Telraam |
Counting Traffic with Telraam - stats after 2 days |
Counting Traffic with Telraam - heavy vehicles |
Top Comments