opencv api blur
时间: 2023-09-23 19:06:50 浏览: 47
The OpenCV API provides the function `cv::blur()` for performing image blurring. The function takes the following arguments:
- `src`: the input image
- `dst`: the output image
- `ksize`: size of the kernel used for blurring. This is a tuple (width, height) of the kernel size.
- `anchor`: position of the anchor point within the kernel. The default value of (-1,-1) means that the anchor is at the center of the kernel.
- `borderType`: border mode used for handling border pixels. The default value is `BORDER_DEFAULT`.
Here's an example usage of `cv::blur()`:
```
cv::Mat src = cv::imread("input.jpg");
cv::Mat dst;
cv::blur(src, dst, cv::Size(5,5));
cv::imshow("Blurred Image", dst);
cv::waitKey(0);
```
This code reads an image from a file, applies a 5x5 Gaussian blur kernel using `cv::blur()`, and displays the result.