{% extends "base.html" %} {% block title %} Sobel {% endblock %} {% block description %}

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

{% endblock %} {% block signature %}
cv2.Sobel(src, ddepth, dx, dy[, dst[, ksize[, scale[, delta[, borderType]]]]])  → dst
{% endblock %} {% block parameters %} {% endblock %} {% block notes %} {% endblock %} {% block 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.

{% endblock %} {% block references %} {% endblock %}