Ejemplo n.º 1
0
def test_mismatched_ndim():
    a = np.zeros((8, 8))
    a[:2] = 2
    a = np.array([a])
    with pytest.raises(ValueError):
        median_filter(a > 0, np.ones((3, 3)))
Ejemplo n.º 2
0
def test_median_filter():
    A = np.zeros((128, 128), bool)
    A[3::3, 3::3] = 1
    Am = median_filter(A)
    assert not Am.any()
    assert Am.shape == A.shape
Ejemplo n.º 3
0
def test_uint8():
    # This used to raise an exception in 0.7.1
    f = np.arange(64 * 4).reshape((16, -1))
    median_filter(f.astype(np.uint8), np.ones((5, 5)))
Ejemplo n.º 4
0
def test_median_filter():
    A = np.zeros((128,128), bool)
    A[3::3,3::3] = 1
    Am = median_filter(A)
    assert not Am.any()
    assert Am.shape == A.shape
Ejemplo n.º 5
0
def test_mismatched_ndim():
    a = np.zeros((8,8))
    a[:2] = 2
    a = np.array([a])
    median_filter(a > 0, np.ones((3,3)))
Ejemplo n.º 6
0
def test_uint8():
    # This used to raise an exception in 0.7.1
    f = np.arange(64*4).reshape((16,-1))
    median_filter(f.astype(np.uint8), np.ones((5,5)))
Ejemplo n.º 7
0
def test_mismatched_ndim():
    a = np.zeros((8, 8))
    a[:2] = 2
    a = np.array([a])
    median_filter(a > 0, np.ones((3, 3)))