特徵偵測

Python 的生醫影像分析

Stephen Bailey

Instructor

邊緣:強度的急遽變化

邊緣偵測的卷積核

Python 的生醫影像分析
im=imageio.imread('foot-xray.jpg')

weights = [[+1, +1, +1], [ 0, 0, 0], [-1, -1, -1]]
edges = ndi.convolve(im, weights)
plt.imshow(edges, cmap='seismic')

足部邊緣

Python 的生醫影像分析

Sobel 濾波器

Sobel:水平

Sobel:垂直

Python 的生醫影像分析

Sobel 濾波器

ndi.sobel(im, axis=0)

水平邊緣

ndi.sobel(im, axis=1)

垂直邊緣

Python 的生醫影像分析

Sobel 強度(幅值)

用距離結合同時的水平與垂直邊緣:

$$z = \sqrt{x^2 + y^2}$$

edges0=ndi.sobel(im, axis=0)
edges1=ndi.sobel(im, axis=1)

edges=np.sqrt(np.square(edges0) + 
              np.square(edges1))
plt.imshow(edges, cmap='gray')

合成邊緣

Python 的生醫影像分析

一起來練習吧!

Python 的生醫影像分析

Preparing Video For Download...