When I was writing my previous post, I stumbled upon a project called Telraam, an initiative to effectively crowdsource traffic flow data in various parts of the world. It appears to be part of another project called WeCount, which is well worth reading up on.
There are several ways to participate. One way is for local governments to set up a network (just a cluster of devices dotted about the area) with help from their citizens. The other, much simpler way, is to set one up yourself. I was pleased to see that the software is open-sourced.
As I'm in the "playing about with stuff" stage, I opted to give the self-service method a go - rather than try to convince Southwark Borough Council that they needed to do a study in my area (Maybe later)
They sell a kit for €95 (or €110 with the software pre-installed), or if you are a serial SBC hoarder like myself, you can also use any Raspberry Pi 3 and Camera module that you happen to have lying around in a drawer...
Once you've assembled the parts, the rest is fortunately pretty simple:
- Download the SD card image from their website
- Flash it to an SD card (using something like balenaEtcher)
- Connect power to the Pi, and wait for it to boot up
I would also recommend you 3D print (or ask someone else - thanks Simon!) one of these, it's a really nice design to attach the camera to the window with, and easier to adjust than just sticking the camera directly to the window. Ahem.
On the initial boot, it will advertise itself as a WiFi hotspot (SSID:
TelraamTelraam) - which you just connect to with your phone or laptop. Once you're connected, open up a web browser and navigate to
http://192.168.254.1, where you will be presented with the following screen.
Use this opportunity to make sure your camera is optimally set up via the handy livestream - and then fill in the WiFi details of your own network and hit save. (Take note of the serial number at the bottom!)
After a few minutes, the device will reboot itself. Once it reboots, it should no longer be visible as a WiFi hotspot (if it is still listed, then it is unable to connect to your network - check the details and try again)
At this stage, you can register the device on the Telraam website - then sit back and let it do it's thing. It will even calibrate itself - which was a welcome change from the previous attempt. For those interested, there is a detailed explanation of how the code works here.
You can see your camera's status on the dashboard, which will look quite bare for the first 24 hrs...
... but eventually it will start to show some graphs with numbers of pedestrians, bicycles, cars and "heavy vehicles" it has counted.
The data in the below screenshots is a bit spotty as I was having some issues with my router a couple of days ago, so missed out on a day of counting. It also doesn't appear to count at night (the other project did), but I wonder if that is because it cannot be as certain about the accuracy as in good light. Maybe with night-vision capable camera it could count at night.
It also tries to keep a track of the kind of speed cars are driving - though like with the previous software I tried, I wouldn't rely on it as concrete information. They have an interesting FAQ about how to interpret the speed chart
You can set it to send a (low res) image once a day, which helps you check the alignment of the camera is still OK. Rather annoyingly, if you knock the camera off the window, or it has slipped - the only way to get back to the screen with the live stream of the camera is to power-cycle the Pi - and it will boot up in hotspot mode again. (Raspberry Pi's do not like having their power yanked out without a shutdown - you may need to reflash the SD card at this point!)
There are 2 essential elements here:
- The images themselves are processed locally and immediately . In other words, it is impossible to consult the images from the camera directly (the device would simply not work if that were the case, by the way, because of insufficient computing power ...)
- The processed data are generic and are not personal data : no number plates, no faces, no characteristics of persons, ...
Conclusion (of sorts)
Overall, this was a much smoother process than my previous attempt. Once I've sorted out positioning, it may even find a permanent place in my window. I may even run the other project alongside it on a Pi Zero to compare their counts. But that's all for another time.
I liked how easy it was to go from zero to counting cars with Telraam. No fiddly calibration to do - and getting it connected to the network was so easy that I reckon even my Dad would be able to do it (with some guidance, he's not a fan of computers!)
I also like the idea behind crowd/open-sourcing the data that is gathered from these devices. With enough of them in a local area, it could be used to empower communities to demonstrate problem areas (Constant speeding? Residential streets being over used as cut-throughs?) to their local authorities - with numbers to back them up.
One could, of course, do all this with the other software... but this is easier - and I'm all for working smarter, not harder.