使用 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