Summary
In this chapter, we built a nice pipeline to detect lanes. First, we analyzed different color spaces, such as RGB, HLS, and HSV, to see which channels would be more useful to detect lanes. Then, we used perspective correction, with getPerspectiveTransform()
, to obtain a bird's eye view and make parallel lines on the road also look parallel on the image we analyzed.
We used edge detection with Scharr()
to detect edges and make our analysis more robust than using only a color threshold, and we combined the two. We then computed a histogram to detect where the lanes start, and we used the "sliding window" technique to "follow" the lane in the image.
Then, we used polyfit()
to fit a second-order polynomial on the pixels detected, making sense of them, and we used the coefficients returned by the function to generate our curve, after having applied reverse perspective correction on them. Finally, we discussed two techniques that can be applied to a...