Jump to content
  • Advertisement
Sign in to follow this  
noatom

Kinect depth problem

This topic is 871 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.
 
Result:
 
Kinect_Screenshot_Depth_09_05_28.png
 
 
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
Advertisement
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 GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!