{% 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 %}
cv2.CV_*
): Output image depth. Default is -1 to use src1.depth()
, and this is used in this app.split()
and process them individually.src
.dst
.cv2.BORDER_*
): Pixel extrapolation method. Default is BORDER_DEFAULT. Choose from:
flip
and set the new anchor to (kernel.cols - anchor.x - 1, kernel.rows - anchor.y - 1)
.
copyMakeBorder
, otherwise the default value is set to 0.
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.