如何使用 Pillow 库给图像应用最小化滤波
在该程序中,我们将使用 pillow 库对图像应用最小值滤波。在最小值滤波中,图像中所选窗口中每个像素的值被该窗口的最小像素值替换。filter 函数用于使用 pillow 库应用不同的滤波。
原始图像

算法
Step 1: Import Image from Pillow. Step 2: Open the image. Step 3: Call the filter function and specify minfilter. Step 4: Display the output.
示例代码
from PIL import Image, ImageFilter
im = Image.open('testimage.jpg')
im1 = im.filter(ImageFilter.MinFilter(size = 7))
im1.show()输出

Advertisement
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
JavaScript
PHP