使用 Pillow 在影像中尋找邊緣
在這個程式中,我們將使用 pillow 庫來查詢影像中的邊緣。ImageFilter 類中的 FIND_EDGES 函式可以幫助我們在影像中找到邊緣。
原始影像

演算法
Step 1: Import Image and ImageFilter from Pillow. Step 2: Open the image. Step 3: Call the filter function and specify the find_edges function. Step 4: Display the output.
示例程式碼
from PIL import Image, ImageFilter
im = Image.open('testimage.jpg')
im = im.filter(ImageFilter.FIND_EDGES)
im.show()輸出

廣告
資料結構
網路
關係型資料庫管理系統 (RDBMS)
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
JavaScript
PHP