Beispiel #1
0
def test_gradient_takeo_double():
    t = takeo.copy()
    t.pixels = t.pixels.astype(np.float64)
    grad_image = gradient(t)

    np_grad = _np_gradient(t.pixels)
    assert_allclose(grad_image.pixels, np_grad)
Beispiel #2
0
def test_gradient_takeo_double():
    t = takeo.copy()
    t.pixels = t.pixels.astype(np.float64)
    grad_image = gradient(t)

    np_grad = _np_gradient(t.pixels)
    assert_allclose(grad_image.pixels, np_grad)
Beispiel #3
0
def test_gradient_takeo_float32():
    dtype = np.float32
    t = takeo.copy()
    t.pixels = t.pixels.astype(dtype)
    grad_image = gradient(t)
    _check_assertions(grad_image, t.shape, t.n_channels * 2, dtype)
    np_grad = _np_gradient(t.pixels)
    assert_allclose(grad_image.pixels, np_grad)
Beispiel #4
0
def test_gradient_takeo_float32():
    dtype = np.float32
    t = takeo.copy()
    t.pixels = t.pixels.astype(dtype)
    grad_image = gradient(t)
    _check_assertions(grad_image, t.shape, t.n_channels * 2,
                      dtype)
    np_grad = _np_gradient(t.pixels)
    assert_allclose(grad_image.pixels, np_grad)