From 6a8889d0b0bb89714755e6f7f0821cd533076af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 3 Oct 2013 08:39:15 +0200 Subject: [PATCH] Fix numpy 1.8 bug --- skimage/morphology/binary.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skimage/morphology/binary.py b/skimage/morphology/binary.py index e2e0f20b..eaea6773 100644 --- a/skimage/morphology/binary.py +++ b/skimage/morphology/binary.py @@ -29,7 +29,7 @@ def binary_erosion(image, selem, out=None): """ - conv = ndimage.convolve(image > 0, selem, output=out, + conv = ndimage.convolve((image > 0).view(np.uint8), selem, output=out, mode='constant', cval=1) if conv is not None: out = conv @@ -64,7 +64,7 @@ def binary_dilation(image, selem, out=None): """ - conv = ndimage.convolve(image > 0, selem, output=out, + conv = ndimage.convolve((image > 0).view(np.uint8), selem, output=out, mode='constant', cval=0) if conv is not None: out = conv