My friend and I did something similar using Haar Cascades for vehicle detection and Hough transforms to detect the lane lines. We used that to analyze dash cam videos and calculate following distance between the cars in the video.
The final product is here, http://asherman.site/hazcam/ and I also release the trained haar classifier separately on my own GitHub in case anyone had another useful projects for it. It was a lot of work hand selecting and cropping 400+ photos of the rear ends of cars, so I figured I might as well share the result. https://github.com/pddenhar/OpenCV-Dashcam-Car-Detection
The final product is here, http://asherman.site/hazcam/ and I also release the trained haar classifier separately on my own GitHub in case anyone had another useful projects for it. It was a lot of work hand selecting and cropping 400+ photos of the rear ends of cars, so I figured I might as well share the result. https://github.com/pddenhar/OpenCV-Dashcam-Car-Detection