def numpy_uint8_to_int16(depth8): x, y, c = depth8.shape out = np.ndarray((x, y), dtype=np.int16) out[:, :] = depth8[:, :, 0] out = np.left_shift(out, 8) out[:, :] += depth8[:, :, 1] return out