Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

let me explain more in detail. After the post by aslund, i did go thru the tutorials. i reached step 8. My supervisor stopped me and wanted me to use openkinect to get the point cloud data. He told me to do the tutorials later. not at the current moment.i need the data for further processing and i using cppview to get the data. I wanted me to urgently to get the point cloud data.so was looking at ways to get it. taught of using this code to get the point cloud data into distance. float gamma[2048];

for (size_t i=0; i<2048; i++) { const float k1 = 1.1863; const float k2 = 2842.5; const float k3 = 0.1236; gamma[i] = k3 * tan(i/k2 + k1); }

Now you have a lookup table for all possible depth values. The second step is to reproject the depth data into Euclidean space.

uint16_t depth_data[640480]; // depth data from Kinect in a 1-D array float x[480640]; // point cloud x values float y[480640]; // point cloud y values float z[480640]; // point cloud z values...you may want to put these into a vector or something // camera intrinsic parameters, representative values, see http://nicolas.burrus.name/index.php/Research/KinectCalibration for more info float cx = 320.0; // center of projection float cy = 240.0; // center of projection float fx = 600.0; // focal length in pixels float fy = 600.0; // focal length in pixels for (size_t v=0, n=0 ; v<480 ; v++) { for (size_t u=0 ; u<640 ; u++, n++) { // note that values will be in meters, with the camera at the origin, and the Kinect has a minimum range of ~0.5 meters x[n] = (u - cx) * gamma[depth_data[n]] / fx; y[n] = (v - cy) * gamma[depth_data[n]] / fy; z[n] = gamma[depth_data[n]]; } would you suggest me to use this code??