|
|
|
|
|
by logfromblammo
3222 days ago
|
|
I'd use two infrared laser LEDs on a PCB with a low-res-but-high-speed infrared light detector, and set up a retroreflector across the street. 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.