cv2.filter2D
时间: 2023-10-29 18:37:00 浏览: 114
cv2.filter2D is a function in OpenCV library that performs 2D convolution on an image. It takes the following arguments:
- src: input image
- ddepth: desired depth of the output image
- kernel: convolution kernel (a numpy array)
- anchor: position of the anchor point in the kernel
- delta: optional value to be added to each pixel after convolution
- borderType: method to handle border pixels (default is cv2.BORDER_DEFAULT)
The function returns the convolved image. Convolution is a mathematical operation that involves multiplying a small matrix (the kernel) with a larger matrix (the image) and summing the results. This operation is commonly used in image processing for tasks such as smoothing, sharpening, edge detection, and feature extraction.
阅读全文