mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-19 11:27:45 +08:00
TST: Add buffer for threshold tests.
In case conversion from float to integer is imprecise.
This commit is contained in:
@@ -74,12 +74,12 @@ class TestSimpleImage():
|
||||
|
||||
def test_otsu_camera_image():
|
||||
camera = skimage.img_as_ubyte(data.camera())
|
||||
assert threshold_otsu(camera) == 87
|
||||
assert 86 < threshold_otsu(camera) < 88
|
||||
|
||||
|
||||
def test_otsu_coins_image():
|
||||
coins = skimage.img_as_ubyte(data.coins())
|
||||
assert threshold_otsu(coins) == 107
|
||||
assert 106 < threshold_otsu(coins) < 108
|
||||
|
||||
|
||||
def test_otsu_coins_image_as_float():
|
||||
@@ -89,7 +89,7 @@ def test_otsu_coins_image_as_float():
|
||||
|
||||
def test_otsu_lena_image():
|
||||
lena = skimage.img_as_ubyte(data.lena())
|
||||
assert threshold_otsu(lena) == 141
|
||||
assert 140 < threshold_otsu(lena) < 142
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user