Merge pull request #227 from thewtex/thresholding_failures_2

BUG: Fix OTSU thresholding tests with matplotlib IO plugin.
This commit is contained in:
tonysyu
2012-07-20 16:37:57 -07:00
+6 -3
View File
@@ -73,11 +73,13 @@ class TestSimpleImage():
def test_otsu_camera_image():
assert threshold_otsu(data.camera()) == 87
camera = skimage.img_as_ubyte(data.camera())
assert 86 < threshold_otsu(camera) < 88
def test_otsu_coins_image():
assert threshold_otsu(data.coins()) == 107
coins = skimage.img_as_ubyte(data.coins())
assert 106 < threshold_otsu(coins) < 108
def test_otsu_coins_image_as_float():
@@ -86,7 +88,8 @@ def test_otsu_coins_image_as_float():
def test_otsu_lena_image():
assert threshold_otsu(data.lena()) == 141
lena = skimage.img_as_ubyte(data.lena())
assert 140 < threshold_otsu(lena) < 142
if __name__ == '__main__':