Table of contents
About the project
A program that reads a video stream and outputs an annotated video that shows the following:
- The current lane
- The radius of curvature of the lane
- The position of the vehicle relative to the middle of the lane
Steps (Figures pending)
- Apply homography transformation to the region of interest into bird’s eye view image.
- White lane detection and Yellow lane detection
- Grayscale and Thresholding to detect the white lanes.
- Transform image to HSV space to set a range for yellow color for yellow lanes.
- Curve fitting the white and yellow lanes with second order polynomial curve.
- Calculate radius of curvature of both lanes.
- Fill the polygon region formed by lane curves.
- Superimposing the polygon region back to the original image by using the inverse of the homography matrix to transform the bird’s eye view image back to the original view image.
Radius of Curvature
The second order polynomial that fits the curve is given by: \(y = a_0 x^2 + a_1 x + a_2\)
The first order derivative is given by: \(\frac{\partial y}{\partial x} = 2 a_0 x + a_1\)
The second order derivative is given by: \(\frac{\partial^2 y}{\partial x^2} = 2 a_0\)
Radius of curvature is computed by the following equation:
\[R = \frac{(1 + (\frac{\partial y}{\partial x})^2)^{\frac{3}{2}}}{\frac{\partial^2 y}{\partial x^2}}\]Turn Prediction
Depending on the value of curvature, the lane turn can be detected:
- The curvature will be high when the lane is straight.
- Positive when there is a right turn.
- Negative when there is a left turn.
Drawbacks
- Using color threshold makes the pipeline sensitive to changes in the environment.
- Choosing four points (Region of Interest - ROI) to warp the image can lead to cases where the lane is not present within the ROI.
- The surrounding area of the lane is set by first finding the histogram of the image and then set boundary with a threshold to the area with highest histogram bar.
Overcoming Drawbacks
- Lane detection using Deep Neural Networks