←back to thread

Raspberry Pi Car Speed Detector

(gregtinkers.wordpress.com)
187 points mhss | 5 comments | | HN request time: 1.86s | source
1. rubyfan ◴[] No.11716752[source]
I wonder if one could figure out other vehicle speeds from a dashboard camera. His method looks like it assumes a stationary view.
replies(2): >>11717265 #>>11718195 #
2. dan_quixote ◴[] No.11717265[source]
Definitely. The code here assumes that the vehicle's vector is perpendicular to the optical axis. If you had enough information to calculate the vector it would just be a little extra trig to measure the relative speed minus the offset of your vehicle's instantaneous speed. This is easy for side to side movement, a little harder in the depth direction - though you could get some depth info by comparing the size of the car contour at two or more snapshots (smaller indicating that it's moving away). The framerate/resolution of the RasPi setup probably wouldn't make it a good choice for this though.
replies(1): >>11720724 #
3. fudged71 ◴[] No.11718195[source]
If you had an OBDII adapter and a camera this should be possible! I'm not sure if there is OBDII communication code for RPI, though
replies(1): >>11719253 #
4. Sanddancer ◴[] No.11719253[source]
There is. There are obd boards that use the standard uarts, and dongles that use bluetooth that you can read from the pi. Here's one guy's project on it. http://fabcirablog.weebly.com/blog/reading-a-cars-obdii-port...
5. rubyfan ◴[] No.11720724[source]
So you definitely need to know your own speed to calculate relative speed of other drivers?

I have a dumb dash cam that's just awesome for video but is nothing more than video to a sd card, ie, not a computer. I've always wondered if I could use just the video using familiar objects like stop signs, mile markers or lane markers to determine my own speed.