Sharing a small example of how OpenKinect and OpenCV work together in Python.

The Python wrapper available for the OpenKinect gives out depth data as a numpy array which conveniently is the datatype used in the cv2 module.

Here the getDepthMap function takes the depth map from the Kinect sensing element, clips the array & so the utmost depth is 1023 (effectively removing distance objects and noise) and turns it into an eight bit array (which OpenCV will render as grayscale). The array returned from getDepthMap are often used like a grayscale OpenCV image – To demonstrate I apply a Gaussian blur. Finally, imshow renders the image in a window and waitKey is there to create certain image updates really show.