Beispiel #1
0
def test_slicing_channel():
  mat = generate_matrix()[:,:,0]
  assert(mat.shape == (10, 12))
  assert(not mat.flags['C_CONTIGUOUS'])
  assert(mat.dtype == np.uint16)
  assert(tm.get_shape(mat) == (10, 12, 1))
  assert(np.all(tm.get_content_as_list(mat) == mat.flatten()))
Beispiel #2
0
def test_slicing_width():
  mat = generate_matrix()[:,:3,:]
  assert(mat.shape == (10, 3, 3))
  assert(not mat.flags['C_CONTIGUOUS'])
  assert(mat.dtype == np.uint16)
  assert(tm.get_shape(mat) == (10, 3, 3))
  assert(np.all(tm.get_content_as_list(mat) == mat.flatten()))
Beispiel #3
0
def test_pass_py2cpp():
  mat = generate_matrix()
  assert(mat.shape == (10, 12, 3))
  assert(mat.flags['C_CONTIGUOUS'])
  assert(mat.dtype == np.uint16)
  assert(tm.check_matrix_content(mat))
  assert(tm.get_shape(mat) == (10, 12, 3))
Beispiel #4
0
def test_noslicing():
  mat = generate_matrix()
  assert(mat.shape == (10, 12, 3))
  assert(mat.flags['C_CONTIGUOUS'])
  assert(mat.dtype == np.uint16)
  assert(tm.get_shape(mat) == (10, 12, 3))
def test_type_uint8_py2cpp():
    mat = generate_matrix().astype(np.uint8)
    assert (tm.check_depth(mat) == "CV_8U")
def test_type_float64_py2cpp():
    mat = generate_matrix().astype(np.float64)
    assert (tm.check_depth(mat) == "CV_64F")
Beispiel #7
0
def test_passthough_py2py():
  mat =  generate_matrix()
  returned_mat = tm.passthru(mat)
  assert(returned_mat.flags['C_CONTIGUOUS'])
  assert(returned_mat.shape == (10, 12, 3))
  assert(check_matrix_content(returned_mat))