本文整理汇总了Python中skimage.filters.thresholding.threshold_otsu函数的典型用法代码示例。如果您正苦于以下问题:Python threshold_otsu函数的具体用法?Python threshold_otsu怎么用?Python threshold_otsu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了threshold_otsu函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_otsu_negative_int
def test_otsu_negative_int(self):
image = self.image - 2
assert threshold_otsu(image) == 0
示例2: test_otsu_float_image
def test_otsu_float_image(self):
image = np.float64(self.image)
assert 2 <= threshold_otsu(image) < 3
示例3: test_otsu_astro_image
def test_otsu_astro_image():
img = skimage.img_as_ubyte(data.astronaut())
with expected_warnings(['grayscale']):
assert 109 < threshold_otsu(img) < 111
示例4: test_otsu
def test_otsu(self):
assert threshold_otsu(self.image) == 2
示例5: test_otsu_coins_image
def test_otsu_coins_image():
coins = skimage.img_as_ubyte(data.coins())
assert 106 < threshold_otsu(coins) < 108
示例6: test_otsu_coins_image_as_float
def test_otsu_coins_image_as_float():
coins = skimage.img_as_float(data.coins())
assert 0.41 < threshold_otsu(coins) < 0.42
示例7: test_otsu_camera_image
def test_otsu_camera_image():
camera = skimage.img_as_ubyte(data.camera())
assert 86 < threshold_otsu(camera) < 88
示例8: test_otsu_one_color_image
def test_otsu_one_color_image():
img = np.ones((10, 10), dtype=np.uint8)
with pytest.raises(ValueError):
threshold_otsu(img)
示例9: test_otsu_astro_image
def test_otsu_astro_image():
img = skimage.img_as_ubyte(data.astronaut())
assert 109 < threshold_otsu(img) < 111
示例10: test_otsu_lena_image
def test_otsu_lena_image():
img = skimage.img_as_ubyte(data.lena())
assert 140 < threshold_otsu(img) < 142
示例11: test_otsu_lena_image
def test_otsu_lena_image():
img = skimage.img_as_ubyte(data.lena())
with expected_warnings(['grayscale']):
assert 140 < threshold_otsu(img) < 142