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

Convolves an image with the kernel.

{% endblock %} {% block signature %}
cv2.filter2D(src, ddepth, kernel[, dst[, anchor[, delta[, borderType]]]]) → dst
{% endblock %} {% block parameters %} {% endblock %} {% block notes %} {% endblock %} {% block explanation %}

The function applies an arbitrary linear filter to an image. In-place operation is supported. When the aperture is partially outside the image, the function interpolates outlier pixel values according to the specified border mode. The function uses the DFT-based algorithm in case of sufficiently large kernels (around \(11 \times 11\) or larger) and the direct algorithm (that uses the engine retrieved by createLinearFilter()) for small kernels.

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