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 ...