Imagine a scenario where you have to detect the lanes within an image of a road. One way to solve this is by leveraging semantic segmentation techniques in deep learning. One of the traditional ways of solving this problem using OpenCV has been using edge and line detectors. In this section, we will learn about how edge detection followed by line detection can help in identifying lanes within an image of a road.
Here, we will have outlined a high-level understanding of the strategy:
- Find the edges of various objects present in the image.
- Identify the edges that follow a straight line and are also connected.
- Extend the identified lines from one end of the image to the other end.
Let's code up our strategy:
The following code is available as detecting_lanes_in_the_image_of_a_road.ipynb in the Chapter18 folder of this book's GitHub repository - https://tinyurl.com/mcvp-packt Be sure to copy the URL from the notebook in GitHub to avoid any...