From bacde61e39526f080373fe8cf85add29c2a0ed13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Scho=CC=88nberger?= Date: Wed, 25 Apr 2012 18:25:19 +0200 Subject: [PATCH] updated test cases for adaptive thresholding --- skimage/filter/tests/test_thresholding.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/skimage/filter/tests/test_thresholding.py b/skimage/filter/tests/test_thresholding.py index ec95e677..4f3daf42 100644 --- a/skimage/filter/tests/test_thresholding.py +++ b/skimage/filter/tests/test_thresholding.py @@ -37,6 +37,17 @@ class TestSimpleImage(): assert_array_equal(ref, out) def test_threshold_adaptive_mean(self): + ref = np.array( + [[False, False, False, False, True], + [False, False, True, False, True], + [False, False, True, True, False], + [False, True, True, False, False], + [ True, True, False, False, False]] + ) + out = threshold_adaptive(self.image, 3, 0, 'mean') + assert_array_equal(ref, out) + + def test_threshold_adaptive_median(self): ref = np.array( [[False, False, False, False, True], [False, False, True, False, False], @@ -44,7 +55,7 @@ class TestSimpleImage(): [False, False, True, True, False], [False, True, False, False, False]] ) - out = threshold_adaptive(self.image, 3, 0, 'mean') + out = threshold_adaptive(self.image, 3, 0, 'median') assert_array_equal(ref, out)