Image Gradients
In this chapter, we will learn to:
- Find Image gradients, edges etc
- We will see following functions : cv.Sobel(), cv.Scharr(), cv.Laplacian() etc
Theory
OpenCV provides three types of gradient filters or High-pass filters, Sobel, Scharr and Laplacian. We will see each one of them.
1. Sobel and Scharr Derivatives
Sobel operators is a joint Gaussian smoothing plus differentiation operation, so it is more resistant to noise. You can specify the direction of derivatives to be taken, vertical or horizontal (by the arguments, yorder and xorder respectively). You can also specify the size of kernel by the argument ksize. If ksize = -1, a 3x3 Scharr filter is used which gives better results than 3x3 Sobel filter. Please see the docs for kernels used.