滞后阈值

磁滞 是一种效果的滞后-一种惯性。在阈值的背景下,这意味着超过一些 low 阈值被认为高于阈值 if 它们也与高于更高、更严格门槛的地区有关。因此,它们可以被视为这些高信任度领域的延续。

下面,我们将正常阈值与滞后阈值进行比较。请注意滞后效应是如何让人忽略硬币边缘之外的“噪音”的。

Original image, Sobel edges, Low threshold, Hysteresis threshold
import matplotlib.pyplot as plt
from skimage import data, filters

fig, ax = plt.subplots(nrows=2, ncols=2)

image = data.coins()
edges = filters.sobel(image)

low = 0.1
high = 0.35

lowt = (edges > low).astype(int)
hight = (edges > high).astype(int)
hyst = filters.apply_hysteresis_threshold(edges, low, high)

ax[0, 0].imshow(image, cmap='gray')
ax[0, 0].set_title('Original image')

ax[0, 1].imshow(edges, cmap='magma')
ax[0, 1].set_title('Sobel edges')

ax[1, 0].imshow(lowt, cmap='magma')
ax[1, 0].set_title('Low threshold')

ax[1, 1].imshow(hight + hyst, cmap='magma')
ax[1, 1].set_title('Hysteresis threshold')

for a in ax.ravel():
    a.axis('off')

plt.tight_layout()

plt.show()

脚本的总运行时间: (0分0.152秒)

Gallery generated by Sphinx-Gallery