microsoftarchive / KinectCommonBridge

Other
113 stars 43 forks source link

Depth data is being clamped at ~4m #9

Closed bgstaal closed 10 years ago

bgstaal commented 10 years ago

I'm experiencing this through the ofxCommonBridge add-on for openFrameworks but I suspect it's clamped at an earlier level. In contrast to when using the libfreenect based ofxKinect add-on it seams impossible to read any depth values beyond 4 meters.

mkostin commented 10 years ago

Clamping takes place at the driver level to maintain a consistent level of quality in the depth and skeleton tracking. You can see related discussion on that matter. Framework has nothing to do with it since that level of functionality would have to come at the technology level not the wrapper.

The Kinect depth sensor range is: minimum 800mm and maximum 4000mm. The Kinect for Windows Hardware can however be switched to Near Mode which provides a range of 500mm to 3000mm instead of the Default range. -- msdn.microsoft.com

To access that data you would have to use 3-d party device driver. But please note that error rate beyond the announced limits makes data not really accurate and not reliable.

mkostin commented 10 years ago

Closing.

bgstaal commented 10 years ago

According to this: http://social.msdn.microsoft.com/Forums/en-US/6dbaa791-bb37-4de2-96ff-eeda61df2c12/raw-unaltered-depth-data-from-the-kinect-possible-with-ms-kinect-sdk?forum=kinectsdknuiapi and this: & this: http://msdn.microsoft.com/en-us/library/microsoft.kinect.depthimageframe.maxdepth.aspx full depth has been available since SDK v.1.6. At least in the C# version of the API. I can't seem to find the C++ equivalent of that function though, but it at least proves that it is not clipped on the driver level.

bgstaal commented 10 years ago

Well, after some research I found out that KCB actually supports access to the extended depth data through the method KinectGetDepthImagePixels witch returns an array of NUI_DEPTH_IMAGE_PIXEL structs with a depth prop that provides the full depth range in mm.

mkostin commented 10 years ago

Thanks for feedback, glad that this has been resolved. Could you please specify what was the way you used before to get depth data that appeared clamped, was it KinectGetDepthFrame?

bgstaal commented 10 years ago

Yes, It was KinectGetDepthFrame. It seems ofxKinectCommonBridge is using an older version of KinectCommonBridge where KinectGetDepthImagePixels isn't available.

IanByun commented 5 years ago

Yes, It was KinectGetDepthFrame. It seems ofxKinectCommonBridge is using an older version of KinectCommonBridge where KinectGetDepthImagePixels isn't available.

changing from KinectGetDepthFrame(hKinect, depthFormat.cbBufferSize, (BYTE*)depthPixelsRawBack.getPixels(), &timestamp)) to KinectGetDepthImagePixels(hKinect, depthFormat.dwWidth*depthFormat.dwHeight, depthPixelsNui, &timestamp)) actually solved the problem. Thanks!