Edge detection intuition

By now, you have an idea of what the edge detection is doing, but let's go back through what's happened so far.

Let's suppose we take the black and white screenshot again, and we have the two filters in different positions: a vertical filter with red, and the horizontal filter with green:

Now, regardless of their position and shape, they have one thing in common: the middle column and the middle row are completely ignored, because of the zeros:

These two filters are only interested in the sides. And depending on these sides' values, we have two states:

When the sides are identical, the difference would be 0, and this means that we won't have any edge:

We're just in the middle of the white, or maybe, in the middle of the black, but not near an edge.

If the sides are different, based on the value of the difference, we shall conclude it is an edge. In this case, it will be 735:

As shown in the preceding screenshot, the place where 735 appears to be, is precisely the edge. This means that a number indicates an edge and 0 indicates no edge, and this is determined by calculating the difference between the sides.

Now, notice how, if we interchange the rows, the terms will be up and 255 will be down; then it will be just minus 735. But if we were to take the convention of using absolute values, then it's still an edge in the end. The edge detection application we'll see in the next section will use absolute values, and you'll see how it's able to detect all the edges in the images.

This was all about edge detection. Now, we'll run a Java edge detection application using different filters than what we have seen so far, and with more complex images, to see what happens.

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

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