mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-17 11:26:12 +08:00
Fix for predefined output array
This commit is contained in:
@@ -29,8 +29,10 @@ def binary_erosion(image, selem, out=None):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
out = ndimage.convolve(image > 0, selem, output=out,
|
conv = ndimage.convolve(image > 0, selem, output=out,
|
||||||
mode='constant', cval=1)
|
mode='constant', cval=1)
|
||||||
|
if conv is not None:
|
||||||
|
out = conv
|
||||||
return np.equal(out, np.sum(selem), out=out)
|
return np.equal(out, np.sum(selem), out=out)
|
||||||
|
|
||||||
|
|
||||||
@@ -62,8 +64,10 @@ def binary_dilation(image, selem, out=None):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
out = ndimage.convolve(image > 0, selem, output=out,
|
conv = ndimage.convolve(image > 0, selem, output=out,
|
||||||
mode='constant', cval=1)
|
mode='constant', cval=1)
|
||||||
|
if conv is not None:
|
||||||
|
out = conv
|
||||||
return np.not_equal(out, 0, out=out)
|
return np.not_equal(out, 0, out=out)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user