開始進入過濾

Python 影像處理

Rebeca Gonzalez

Data Engineer

濾波器

  • 強化影像
  • 強調或移除特徵
  • 平滑化
  • 銳利化
  • 邊緣偵測
Python 影像處理

鄰域

濾波鄰域

Python 影像處理

邊緣偵測

偵測出邊緣的硬幣

Python 影像處理

邊緣偵測

巧克力錫紙吻的原始影像

偵測出邊緣的巧克力錫紙吻影像

Python 影像處理

邊緣偵測

Sobel
# Import module and function 
from skimage.filters import sobel

# Apply edge detection filter edge_sobel = sobel(image_coins)
# Show original and resulting image to compare plot_comparison(image_coins, edge_sobel, "Edge with Sobel")
Python 影像處理

邊緣偵測

Sobel

偵測出邊緣後呈現形狀的硬幣影像

Python 影像處理

比較圖

def plot_comparison(original, filtered, title_filtered):

    fig, (ax1, ax2) = plt.subplots(ncols=2, figsize=(8, 6), sharex=True,
                                   sharey=True)
    ax1.imshow(original, cmap=plt.cm.gray)
    ax1.set_title('original')
    ax1.axis('off')
    ax2.imshow(filtered, cmap=plt.cm.gray)
    ax2.set_title(title_filtered)
    ax2.axis('off')
Python 影像處理

Gaussian 平滑化

狗的影像與套用 Gaussian 濾波後的對照

Python 影像處理

Gaussian 平滑化

Rebeca 在阿姆斯特丹橋上牽著腳踏車

Python 影像處理

Gaussian 平滑化

# Import the module and function
from skimage.filters import gaussian

# Apply edge detection filter gaussian_image = gaussian(amsterdam_pic, multichannel=True)
# Show original and resulting image to compare plot_comparison(amsterdam_pic, gaussian_image, "Blurred with Gaussian filter")
Python 影像處理

Gaussian 平滑化

輸出影像

Python 影像處理

Gaussian 平滑化

放大後的輸出影像

Python 影像處理

一起來練習吧!

Python 影像處理

Preparing Video For Download...