This is a simple tutorial helps you to get the 3D coordinates from Kinect using OpenNI library
Example Code showing the usage of this snippet. This code combine OpenCV and OpenNI. It gives X,Y,Z coordinate of the desired x,y pixel that we supply through command line argument.
Setting OpenCV in Windows
Installing OpenNI in Windows 7
Setting OpenNI in Visual studio 2010
Code snippet
xn::DepthGenerator & Xn_depth;
const XnDepthPixel * pDepthMap = Xn_depth.GetDepthMap();
XnPoint3D Point2D, Point3D;
Point2D.X = ii; //x-pixels
Point2D.Y = jj; //y-pixels
Point2D.Z = pDepthMap[jj*640+ii];Xn_depth.ConvertProjectiveToRealWorld(1, &Point2D, &Point3D);
Example Code showing the usage of this snippet. This code combine OpenCV and OpenNI. It gives X,Y,Z coordinate of the desired x,y pixel that we supply through command line argument.
Setting OpenCV in Windows
Installing OpenNI in Windows 7
Setting OpenNI in Visual studio 2010



