使用 OpenCV 函数 blur() 模糊图像
在本教程中,我们将使用 opencv 函数 blur() 模糊图像。
算法
Step 1: Import OpenCV. Step 2: Import the image. Step 3: Set the kernel size. Step 4: Call the blur() function and pass the image and kernel size as parameters. Step 5: Display the results.
原始图像

示例代码
import cv2
image = cv2.imread("testimage.jpg")
kernel_size = (7,7)
image = cv2.blur(image, kernel_size)
cv2.imshow("blur", image)输出
模糊图像

解释
核大小用于仅模糊图像的一小部分。核在整个图像上移动并模糊其覆盖的像素。
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP