Sobel

Description

Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator.

Signature

cv2.Sobel(src, ddepth, dx, dy[, dst[, ksize[, scale[, delta[, borderType]]]]])  → dst

Parameters

Explanation

This function calculates the first, second, third, or mixed image derivatives using an extended Sobel operator. In most cases, the ksize \(\times\) ksize separable kernel is used to calculate the derivative. The exception occurs when ksize=1, and the \(3 \times 1\) or \(1 \times 3\) kernel is used and no Gaussian smoothing is performed.

The function calculates an image derivative by convolving the image with the appropriate kernel: $$\texttt{dst}=\frac{\partial^{\texttt{dx}+\texttt{dy}} \texttt{src}} { {\partial x}^{\texttt{dx}}{\partial y}^{\texttt{dy}}}$$ The Sobel operators combine Gaussian smoothing and differentiation, so the result is more or less resistant to the noise.

Notes


References

Created with OpenCV 4.4.0