by telot1 · 9y ago · 0 comments
You'd only get an average speed but that should be enough to catch the worst offenders.
Something like this[1] has been used on UK motorways for a while.
I'm admittedly rather unqualified in this area (I don't even know what the ITS industry is!) but I have experience in estimating distances from video and calculating speeds from pixel displacement (particle image velocimetry) and at first pass it seems to me this would be a fairly straightforward problem to solve.
Obviously radar or lidar would be preferable but a quick search for "OpenCV speed estimation" shows people having success with simple single <$50 camera setups.
If the LEDs are 10cm apart, and parallel to the street, and left dot vanishes 7.45645 ms after the right dot, then something was moving through the beams from right to left at 30 miles per hour (13.4112 m/s). If right dot vanishes 4.06716 ms after left dot, something was moving left to right at 55 mph (24.5872 m/s).
You can even get an estimate of vehicle length and acceleration if you watch for the dots to reappear.
The frame rates and resolutions of most cameras aren't great for precisely estimating speed. You would need a high-speed camera, which is wasted on a surveillance application. So you just use two cameras, one that sees 16 infrared pixels with an ultra high frame rate, and one that sees many RGB pixels at 24 fps.
Set up your RPi camera about 20m from the road, with it's FOV that'll give you about 20 m of road coverage. Rule of thumb in my world is that the items of interest should not move more than 1/4 of window width between frames. So that's 5m, to move 5m between frames at 30Hz you'd need to be doing about 300 mph. More realistically the car might be doing 25m/s giving you an inter-frame displacement of 0.8m ~130px. If that's too little for your software to register just up the inter-frame time.
How good do you think the numbers would be? For example, the speed limit on my road is 25 mph but I know people routinely drive through at 40 mph. Would a camera system be good enough to record, say, 30 mph with error bars equal to +/- 5 mph?