This is the basic code to display depth image from kinect using openni. OpenCV is built with openni "ON".