使用 Pillow 库对图像应用高斯模糊
在此程序中,我们将使用高斯滤波器模糊图像。Pillow 库中的 ImageFilter 类包含一个名为 GaussianBlur() 的函数,该函数有助于应用高斯模糊滤波器。它只接受一个参数,即模糊半径。
原图像

算法
Step 1: Import Image and ImageFilter from Pillow. Step 2: Open the image. Step 3: Call the gaussianblur() method and specify the radius Step 4: Display the output.
示例代码
from PIL import Image, ImageFilter
im = Image.open('image_test.jpg')
im1 = im.filter(ImageFilter.GaussianBlur(radius = 9))
im1.show()输出

广告
数据结构
网络
关系型数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程语言
C++
C#
MongoDB
MySQL
Javascript
PHP