Sample code to detect lanes in the highway images and track it's x-intercept value in the image.
To account for real world lighting conditions, we can use Adaptive Bilateral Filtering (selectively smooth the image and preserves the edges) and Histogram Equalizations. Below pictures show the results.
From the enhanced images, Canny Edge Detector is used to detect the edges in the image and filter out the noisy edges. Using this binay image from the edge detctor, Hough Transform is used to extract the line information. All the detected lines are used to vote for the possible x-intercept value and strength proportional to their importance and location. Below is one example:
Once the lane is detected in one image, it's x-intercept values is used in Particle Filter to track the x-intercept values in the next images from the video sequence.