{% extends "base.html" %} {% block title %} sepFilter2D {% endblock %} {% block description %}
Applies a separable linear filter to an image.
{% endblock %} {% block signature %}cv2.sepFilter2D(src, ddepth, kernelX, kernelY[, dst[, anchor[, delta[, borderType]]]]) → dst{% endblock %} {% block parameters %}
cv2.CV_8U, cv2.CV_16U, cv2.CV_16S, cv2.CV_32F or cv2.CV_64F.cv2.CV_*): Output image depth. Recommended value is -1 to use src1.depth(), and this is used in this app.src. cv2.BORDER_*): Pixel extrapolation method. Default is BORDER_DEFAULT. One of the following:
copyMakeBorder, otherwise the default value is set to 0.
The function applies a separable linear filter to the image in two steps. That is, first, every row of src is filtered with the 1D kernel, kernelX. Then, every column of the result is filtered with the 1D kernel, kernelY. The final result is shifted by delta is stored in dst.
For example, consider the following image.
sepFilter2D with kernelX=[1,2,1] and kernelY=[0,1,0] (the identity kernel) to get the following image, illustrating a 1-dimensional kernel across X.
sepFilter2D with kernelX=[0,1,0] (the identity kernel) and kernelY=[1,0,-1] to get the following image, illustrating a 1-dimensional kernel across Y.
sepFilter2D with kernelX=[1,2,1] and kernelY=[1,0,-1] to get the following image, illustrating a 2-dimensional kernel across X and Y.