開始使用免費開始

濾波器卷積

「濾波器」(filters)是影像處理中不可或缺的工具。它讓你能依據某像素周圍的強度值來轉換影像,而不是對整張影像一次處理。

2D array convolution. By Michael Plotke [CC BY-SA 3.0  (https://creativecommons.org/licenses/by-sa/3.0)], from Wikimedia Commons

在這個練習中,請把足部 X 光影像做平滑處理。首先,指定要使用的權重(也常稱為「footprint」或「kernel」)。接著,將濾波器與 im 做卷積,並繪製結果。

本練習屬於課程

Python 的生醫影像分析

檢視課程

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Set filter weights
weights = [[0.11, 0.11, ____],
           [0.11, ____, 0.11], 
           ____]
編輯並執行程式碼