reduce kinect data

Hi list, how can i reduce the number of point values from a pointcloud ?
I need to have no more that 4000 point cloud values.
Which is the easiest way of achieving this?




As you don´t provide info on how you’re getting kinect data maybe you’re talking about parsing/saving data? Not sure if this is what you need but maybe you can try something simple like:

int w = 640; // width & height of the point cloud  
int h = 480;  
int step = 2; // Higher step less data you read from the point cloud.  
int pIndex = 0; // Keep track of the point Index to get info on coords.  
 for(int y = 0; y < h; y += step) {  
        for(int x = 0; x < w; x += step, pIndex++) {  
               // Do stuff here.