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);
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);
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.