Method Filter2D
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
Filter2D(InputArray, OutputArray, MatType, InputArray, Point?, double, BorderTypes)
Convolves an image with the kernel
public static void Filter2D(InputArray src, OutputArray dst, MatType ddepth, InputArray kernel, Point? anchor = null, double delta = 0, BorderTypes borderType = BorderTypes.Default)
Parameters
srcInputArrayThe source image
dstOutputArrayThe destination image. It will have the same size and the same number of channels as src
ddepthMatTypeThe desired depth of the destination image. If it is negative, it will be the same as src.depth()
kernelInputArrayConvolution kernel (or rather a correlation kernel), a single-channel floating point matrix. If you want to apply different kernels to different channels, split the image into separate color planes using split() and process them individually
anchorPoint?The anchor of the kernel that indicates the relative position of a filtered point within the kernel. The anchor should lie within the kernel. The special default value (-1,-1) means that the anchor is at the kernel center
deltadoubleThe optional value added to the filtered pixels before storing them in dst
borderTypeBorderTypesThe pixel extrapolation method
Filter2D(InputArray, OutputArray, InputArray, Filter2DParams?)
Convolves an image with the kernel (OpenCV 5 parameter-struct overload).
public static void Filter2D(InputArray src, OutputArray dst, InputArray kernel, Filter2DParams? @params = null)
Parameters
srcInputArrayinput image.
dstOutputArrayoutput image of the same size and the same number of channels as src.
kernelInputArrayconvolution kernel (or rather a correlation kernel), a single-channel floating point matrix.
paramsFilter2DParamsfiltering parameters (anchor, border, depth, scale, shift). Null uses the defaults.