From f478b6a397e2efc481844c52133c2e909243257c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Tue, 11 Sep 2012 20:11:55 +0200 Subject: [PATCH] Fix bug in binary dilation and test case --- skimage/morphology/binary.py | 2 +- skimage/morphology/tests/test_grey.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/skimage/morphology/binary.py b/skimage/morphology/binary.py index ffd79482..e2e0f20b 100644 --- a/skimage/morphology/binary.py +++ b/skimage/morphology/binary.py @@ -65,7 +65,7 @@ def binary_dilation(image, selem, out=None): """ conv = ndimage.convolve(image > 0, selem, output=out, - mode='constant', cval=1) + mode='constant', cval=0) if conv is not None: out = conv return np.not_equal(out, 0, out=out) diff --git a/skimage/morphology/tests/test_grey.py b/skimage/morphology/tests/test_grey.py index 6d2b75e8..31a33321 100644 --- a/skimage/morphology/tests/test_grey.py +++ b/skimage/morphology/tests/test_grey.py @@ -10,7 +10,7 @@ from skimage.morphology import binary, grey, selem lena = np.load(os.path.join(data_dir, 'lena_GRAY_U8.npy')) -bw_lena = lena > 0.4 +bw_lena = lena > 100 class TestMorphology():