I reached the end of poking traffic cams. I ended up with a system that:

  1. Polled all the cameras every 10m.
  2. Ran each camera through a image recognition model, counts the number of cars in the image.
  3. exports the count to Prometheus.

This blog is a very similar counting system.

How well does it work?

Here’s some traffic I got stuck in.

2024-11-09T15:24:10

You can see that the bulk of the traffic is to the top middle of the picture, and isn’t counted.

Here’s another problem: traffic is all on one side of the road.

2024-11-09T15:23:42

Also, the weather.

2024-11-09T11:33:27.jpg

However, sometimes the results are artistic.

2024-11-04T02:03:35.jpg

And a graph

graph.png