Edge detection is a very important feature-extraction technique in computer vision that is used in self-driving cars to go beyond convolution, which we discussed in the previous section. In the previous section, we learned how to extract edges within an image. We converted a color image to grayscale or HSV, and later applied convolution to an image to extract features from it. In this section, we will learn about edge detection and gradient calculation.
Edge detection is a computer-vision feature-extraction tool that is used to detect the sharp changes in an image.
Let's say that we have three pixels. The first pixel is white, which is represented by 255 (as we have already learned in a previous section of this chapter); the next pixel is 0, which represents black; and the third pixel is also 255. So this means that we are going from white to black and then back to white. Edge detection happens when pixels change...