mirror of
https://github.com/wassname/scikit-image.git
synced 2026-09-12 12:50:49 +08:00
replacing lena in examples and most tests
This commit is contained in:
committed by
Stefan van der Walt
parent
e8967abe78
commit
1b217f971e
@@ -7,42 +7,42 @@ from skimage.morphology import binary, grey, selem
|
||||
from scipy import ndimage
|
||||
|
||||
|
||||
lena = color.rgb2gray(data.lena())
|
||||
bw_lena = lena > 100
|
||||
img = color.rgb2gray(data.astronaut())
|
||||
bw_img = img > 100
|
||||
|
||||
|
||||
def test_non_square_image():
|
||||
strel = selem.square(3)
|
||||
binary_res = binary.binary_erosion(bw_lena[:100, :200], strel)
|
||||
grey_res = img_as_bool(grey.erosion(bw_lena[:100, :200], strel))
|
||||
binary_res = binary.binary_erosion(bw_img[:100, :200], strel)
|
||||
grey_res = img_as_bool(grey.erosion(bw_img[:100, :200], 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)
|
||||
grey_res = img_as_bool(grey.erosion(bw_lena, strel))
|
||||
binary_res = binary.binary_erosion(bw_img, strel)
|
||||
grey_res = img_as_bool(grey.erosion(bw_img, strel))
|
||||
testing.assert_array_equal(binary_res, grey_res)
|
||||
|
||||
|
||||
def test_binary_dilation():
|
||||
strel = selem.square(3)
|
||||
binary_res = binary.binary_dilation(bw_lena, strel)
|
||||
grey_res = img_as_bool(grey.dilation(bw_lena, strel))
|
||||
binary_res = binary.binary_dilation(bw_img, strel)
|
||||
grey_res = img_as_bool(grey.dilation(bw_img, strel))
|
||||
testing.assert_array_equal(binary_res, grey_res)
|
||||
|
||||
|
||||
def test_binary_closing():
|
||||
strel = selem.square(3)
|
||||
binary_res = binary.binary_closing(bw_lena, strel)
|
||||
grey_res = img_as_bool(grey.closing(bw_lena, strel))
|
||||
binary_res = binary.binary_closing(bw_img, strel)
|
||||
grey_res = img_as_bool(grey.closing(bw_img, strel))
|
||||
testing.assert_array_equal(binary_res, grey_res)
|
||||
|
||||
|
||||
def test_binary_opening():
|
||||
strel = selem.square(3)
|
||||
binary_res = binary.binary_opening(bw_lena, strel)
|
||||
grey_res = img_as_bool(grey.opening(bw_lena, strel))
|
||||
binary_res = binary.binary_opening(bw_img, strel)
|
||||
grey_res = img_as_bool(grey.opening(bw_img, strel))
|
||||
testing.assert_array_equal(binary_res, grey_res)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user