From b187144a5fe24d0370a77d36c656eeabfd885690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 10 Oct 2013 09:04:17 +0200 Subject: [PATCH] Add support older numpy versions --- skimage/morphology/binary.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/skimage/morphology/binary.py b/skimage/morphology/binary.py index 4a7b1578..d248d8db 100644 --- a/skimage/morphology/binary.py +++ b/skimage/morphology/binary.py @@ -58,7 +58,8 @@ def binary_erosion(image, selem, out=None): """ out, selem_sum = _convolve(image, selem, out, 1) - return np.equal(out, selem_sum, out=out).astype(np.bool, copy=False) + return np.array(np.equal(out, selem_sum, out=out), dtype=np.bool, + copy=False) def binary_dilation(image, selem, out=None): @@ -90,7 +91,7 @@ def binary_dilation(image, selem, out=None): """ out, _ = _convolve(image, selem, out, 0) - return np.not_equal(out, 0, out=out).astype(np.bool, copy=False) + return np.array(np.not_equal(out, 0, out=out), dtype=np.bool, copy=False) def binary_opening(image, selem, out=None):