岭算子#

脊滤波器可以用于检测脊状结构,如神经元 [1]、管状物 [2]、血管 [3]、皱纹 [4] 或河流。

不同的岭滤波器可能适用于检测不同的结构,例如,取决于对比度或噪声水平。

当前这一类脊线滤波器依赖于图像强度Hessian矩阵的特征值来检测脊线结构,这些结构在强度变化垂直于结构方向,而不是沿着结构方向。

参考文献#

original, meijering σ = [1], meijering σ = [1, 2, 3, 4], sato σ = [1], sato σ = [1, 2, 3, 4], frangi σ = [1], frangi σ = [1, 2, 3, 4], hessian σ = [1], hessian σ = [1, 2, 3, 4]
from skimage import data
from skimage import color
from skimage.filters import meijering, sato, frangi, hessian
import matplotlib.pyplot as plt


def original(image, **kwargs):
    """Return the original image, ignoring any kwargs."""
    return image


image = color.rgb2gray(data.retina())[300:700, 700:900]
cmap = plt.cm.gray

plt.rcParams["axes.titlesize"] = "medium"
axes = plt.figure(figsize=(10, 4)).subplots(2, 9)
for i, black_ridges in enumerate([True, False]):
    for j, (func, sigmas) in enumerate(
        [
            (original, None),
            (meijering, [1]),
            (meijering, range(1, 5)),
            (sato, [1]),
            (sato, range(1, 5)),
            (frangi, [1]),
            (frangi, range(1, 5)),
            (hessian, [1]),
            (hessian, range(1, 5)),
        ]
    ):
        result = func(image, black_ridges=black_ridges, sigmas=sigmas)
        axes[i, j].imshow(result, cmap=cmap)
        if i == 0:
            title = func.__name__
            if sigmas:
                title += f"\n\N{GREEK SMALL LETTER SIGMA} = {list(sigmas)}"
            axes[i, j].set_title(title)
        if j == 0:
            axes[i, j].set_ylabel(f'{black_ridges = }')
        axes[i, j].set_xticks([])
        axes[i, j].set_yticks([])

plt.tight_layout()
plt.show()

脚本总运行时间: (0 分钟 1.248 秒)

由 Sphinx-Gallery 生成的图库