With all this focus on self-driving cars, nobody is looking at the low-hanging fruit - cameras on the traffic lights. No, not for ticketing people, but for changing the signals in a way that maximizes flow. This will save time and an awful lot of gas. With all the sophisticated camera algorithms these days, this should be a relatively simpler problem to detect the speed, number, and distance of cars coming from each direction.
It can also be used to save lives - the light for the cross street need not turn green when the other turns red if there looks like a car is going to run the red. If there are pedestrians in the intersection, the lights can also remain red.
You can detect speed,ount and types ofcas with a pair of inductive loops (car length determines the type pretty well). I'd guess that putting such a pair some distance before the intersection would be a lot simpler (cars would obscure each other in the camera's view). That said, this would give you information about cars passing a single point on the road and would give you no information about pedestrians.
This has been implemented for some traffic lights in Warsaw, and has one more bad side effect (possibly because of bad implementation): if you a bike in the late evening on the smaller street, that's configured "red unless there's a car that will be crossing" to maximize throughput of the bigger street, you have to wait for a car or use a pedestrian crossing, because the loops won't detect a bike.
Lots (most?) of the traffic light controlled junctions in the UK have induction loops to detect cars. I have personally complained to the authorities about their lack of ability to detect bicycles.
It can also be used to save lives - the light for the cross street need not turn green when the other turns red if there looks like a car is going to run the red. If there are pedestrians in the intersection, the lights can also remain red.