# kinect distanceAt range

Hi.

i am working on a near and far threshold for my kinect point cloud.

what are the min and max values that one gets back for the z axis when using kinect.getWorldCoordinateAt(x, y)

thanks,
stephan.

I am trying to connect my near and far threshold setting for the opencv tracking in such a way that the kinect point cloud also just shows those points that are within the tracked area.

So far getDistanceAt() returns values between 411 and 9757. But I am not sure that mapping the 0-255 opencv threshold value should be mapped in a linear fashion to the 411-9757.

I think I read somewhere that there is a logarithmic relationship ???

thx. s.

I know I have seen the values commented somewhere but I couldn’t quickly find them

Here are a couple of good pages that probably can get you there

http://futuretheater.net/wiki/Kinect-Workshop

http://www.ros.org/wiki/kinect-calibration/technical

distanceAt() returns the distance in millimeters from the kinect.

getWorldCoordinateAt() returns the position in millimeters with kinect at the origin.

the largest possible distanceAt() value is 10 meters (10000). if you’re seeing 411 to 9757 that means that your kinect can see between .4 m to 9.7 m.

thanks for the info. it helped.

here is what worked for me.
now when i adjust the near and far threshold for the opencv tracking it also crops the point cloud.
it’s not a perfect match but tweaking cloudZmin and cloudZmax should do the trick.

``````

int cloudZmin = 223;
int cloudZmax = 8430;
float cloudZThresholdSteps = (cloudZmax - cloudZmin) / 255.0;

cloudNearThreshold = cloudZmin + ((255-nearThreshold) * cloudZThresholdSteps);
cloudFarThreshold = cloudZmin + ((255-farThreshold) * cloudZThresholdSteps);

``````