5 """Converts depth into a 'nicer' format for display 7 This is abstracted to allow for experimentation with normalization 10 depth: A numpy array with 2 bytes per pixel 13 A numpy array that has been processed whos datatype is unspecified 15 np.clip(depth, 0, 2**10 - 1, depth)
17 depth = depth.astype(np.uint8)
22 """Converts depth into a 'nicer' format for display 24 This is abstracted to allow for experimentation with normalization 27 depth: A numpy array with 2 bytes per pixel 30 An opencv image who's datatype is unspecified 34 image = cv.CreateImageHeader((depth.shape[1], depth.shape[0]),
37 cv.SetData(image, depth.tostring(),
38 depth.dtype.itemsize * depth.shape[1])
43 """Converts video into a BGR format for opencv 45 This is abstracted out to allow for experimentation 48 video: A numpy array with 1 byte per pixel, 3 channels RGB 51 An opencv image who's datatype is 1 byte, 3 channel BGR 54 video = video[:, :, ::-1]
55 image = cv.CreateImageHeader((video.shape[1], video.shape[0]),
58 cv.SetData(image, video.tostring(),
59 video.dtype.itemsize * 3 * video.shape[1])
def pretty_depth_cv(depth)