mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-04 23:38:16 +08:00
updated test cases for adaptive thresholding
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user