Simplify output handling for binary morphology.

This commit is contained in:
Stefan van der Walt
2013-10-12 19:10:23 +02:00
parent 2c7bf856f5
commit b022dd6dfb
2 changed files with 18 additions and 71 deletions
-21
View File
@@ -17,27 +17,6 @@ def test_non_square_image():
testing.assert_array_equal(binary_res, grey_res)
def test_selem_overflow():
strel = np.ones((17, 17), dtype=np.uint8)
img = np.zeros((20, 20))
img[2:19, 2:19] = 1
binary_res = binary.binary_erosion(img, strel)
grey_res = img_as_bool(grey.erosion(img, strel))
testing.assert_array_equal(binary_res, grey_res)
def test_selem_overflow_exception():
strel = np.ones((17, 17), dtype=np.uint8)
img = np.zeros((20, 20))
img[2:19, 2:19] = 1
out = np.zeros((20, 20), dtype=np.uint8)
testing.assert_raises(ValueError, binary.binary_erosion, img, strel, out)
out = np.zeros((20, 20), dtype=np.uint16)
binary_res = binary.binary_erosion(img, strel, out=out)
grey_res = img_as_bool(grey.erosion(img, strel))
testing.assert_array_equal(binary_res, grey_res)
def test_binary_erosion():
strel = selem.square(3)
binary_res = binary.binary_erosion(bw_lena, strel)