Horizontal edge detection

Let's see horizontal edge detection. Here, when compared to vertical edge detection, white depicts up and black depicts down. The edge is supposed to be as shown in the following screenshot:

If we were to represent this in the matrix, it would be as shown in the preceding screenshot. As you can see, it's just a flipped version of the vertical filter. The ones that were columns are now rows. The zeros that were the middle column now form the middle row, and the minus one that was the last column is now the last row. This is called a horizontal filter. And if we were able to execute the convolution as we saw previously in the routine, we will get this 64 matrix. Again, the dimensions have shrunk, and if we were to show this using Java and the conversion we already mentioned, the values greater than 255 are just white, and the sides that we are not interested in are black, but in the middle right away, when we expect the edge, we have the white region. This region is wide because the pixel measures are small, but if we execute it, as we will do in the next chapter, in normal images it should be quite narrow, actually detecting the edge in the white region.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.228.88