def pretty_depth_cv(depth):
 import cv
 depth = pretty_depth(depth)
 image = cv.CreateImageHeader((depth.shape[1], depth.shape[0]), cv.IPL_DEPTH_8U, 1)
 cv.SetData(image, depth.tostring(), (depth.dtype.itemsize * depth.shape[1]))
 return image

def pretty_depth_cv ( depth ) : import cv depth = pretty_depth ( depth ) image = cv . CreateImageHeader ( ( depth . shape [ 1 ] , depth . shape [ 0 ] ) , cv . IPL_DEPTH_8U , 1 ) cv . SetData ( image , depth . tostring ( ) , ( depth . dtype . itemsize * depth . shape [ 1 ] ) ) return image
converts depth into a nicer format for display this is abstracted to allow for experimentation with normalization args: depth: a numpy array with 2 bytes per pixel returns: an opencv image whos datatype is unspecified .