Advertisement Jump to content
Sign in to follow this  

Kinect depth problem

This topic is 1055 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to convert depth data to pixels(8 bit).


I tried the default formula:

BYTE intensity = static_cast<BYTE>((depth >= nMinDepth) && (depth <= nMaxDepth) ? (depth % 256) : 0);


 pRGBX->rgbRed   = intensity;
 pRGBX->rgbGreen = intensity;
 pRGBX->rgbBlue  = intensity;
However that has a lot of banding issues. I need to get rid of the banding.
So what I did was take the min & max depth values from the kinect, and use them to normalize any depth value the kinect sends me.
After that I would just multiply the normalized value with 255.
The banding is gone however there are still issues such as: there's not much diversity in range, i mean the values are either very close to black, or quite close to white. And most importantly, the artifacts, especially those in the upper right corner.
Any ideas for improvements?

Share this post

Link to post
Share on other sites
I dunno, that seems to have plenty of dynamic range to me. You are talking about a 0-255 gradient, so there's only so much visual data you can capture.

Looks more like a calibration problem to me, although I have no idea how configurable the Kinect sensors are.

Share this post

Link to post
Share on other sites

NUI data is 16 bits with 3 reserved bits for player masks.

I.e., the conversion looks like: (((unsigned short*)depthPixels)[(((i * depthWidth)+j))] >> 3)


Which means that if you want to destroy your data and convert to 8 bit, that you need to scale by 2^13-1 instead of 2^8-1.

awfulDepth = (((kinectDepth >> 3) / 2^13-1)) * (2^8-1).


Why on earth you would want to do this is beyond me, but good luck.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!