使用 Pillow 庫對影像應用 Box Blur
在此專案中,我們將使用 Box 濾波器對影像進行模糊處理。pillow 庫中的 ImageFilter 類包含一個名為 BoxBlur() 的函式,該函式有助於應用 Box 模糊濾波器。它只接受一個引數,即模糊半徑。
原始影像

演算法
Step 1: Import Image and ImageFilter from Pillow. Step 2: Open the image. Step 3: Call the boxblur() 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.BoxBlur(radius = 7))
im1.show()輸出

廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP