Enhancing a video
Analyzing a video stream in real time can be a challenge from a computational point of view, but usually, it offers the possibility to improve precision, as we can build on knowledge from the previous frames and filter the result.
We will now see two techniques that can be used to detect lanes with better precision when working with video streams.
Partial histogram
If we assume that we correctly detected a lane in the previous few frames, then the lane on the current frame should be in a similar position. This assumption is affected by the speed of the car and the frame rate of the camera: the faster the car, the more the lane could change. Conversely, the faster the camera, the less the lane could have moved between two frames. In a real self-driving car, both these values are known, so they can be taken into consideration if required.
From a practical point of view, this means we can limit the part of the histogram that we analyze, to avoid false detections...