We have just implemented and applied our own derivative filter to an image. Since computing the derivative is quite a fundamental operation in computer vision and image processing, we typically do not want to burden the programmer with the task of having to populate the filter all by himself (as we just did). It is no surprise that OpenCV provides you with a function that can return the final output of the image derivative operation. Also, by varying the parameters of the function call, you can compute both the x and y derivatives. The function's name is Sobel()
, named after Irwin Sobel, who came up with the design of this filter along with Gary Feldman in 1968.
What is so special about this filter? Well, the design is slightly different from what we implemented just now. For example, the x-derivative filter is shown as follows:
If you look carefully, you will notice a subtle difference in the Sobel filter. The middle row has been multiplied by two. What this...