特征检测

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...