Exemplo n.º 1
0
 def test_2D_array(self):
     a = np.array([[1], [2]])
     b = np.array([[1], [2]])
     res = dstack([a, b])
     desired = np.array([[[1, 1]], [[
         2,
         2,
     ]]])
     assert_array_equal(res, desired)
Exemplo n.º 2
0
 def test_generator(self):
     with assert_warns(FutureWarning):
         dstack((np.arange(3) for _ in range(2)))
Exemplo n.º 3
0
 def test_1D_array(self):
     a = np.array([1])
     b = np.array([2])
     res = dstack([a, b])
     desired = np.array([[[1, 2]]])
     assert_array_equal(res, desired)
Exemplo n.º 4
0
 def test_2D_array2(self):
     a = np.array([1, 2])
     b = np.array([1, 2])
     res = dstack([a, b])
     desired = np.array([[[1, 1], [2, 2]]])
     assert_array_equal(res, desired)
Exemplo n.º 5
0
 def test_0D_array(self):
     a = np.array(1)
     b = np.array(2)
     res = dstack([a, b])
     desired = np.array([[[1, 2]]])
     assert_array_equal(res, desired)
Exemplo n.º 6
0
 def test_generator(self):
     with assert_warns(FutureWarning):
         dstack((np.arange(3) for _ in range(2)))
Exemplo n.º 7
0
def getBlackWhiteFromBinary(img):
    return dstack((img,img,img))