Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've tried it myself. Normally the depth datas are 16bit values. The 13 high-order bits contain the distance and the 3 low-order bits contain the user segmentation map.</p> <p>The user segmentation map is only built if skeleton tracking is active, which I believe was not in your example. Although the rgb values are 24bit it seems to work. I get an image from the segmented hand.</p> <pre><code>Bitmap bmpOrg = new Bitmap("bKawM.png"); Bitmap bmp = new Bitmap(106, 119); for (int i = 0; i &lt; 106;i++ ) { for (int j = 0; j &lt; 119;j++ ) { Color rgb = bmpOrg.GetPixel(i, j); int bit24 = (rgb.B &lt;&lt; 16 + rgb.G &lt;&lt; 8 + rgb.R); int user = bit24 &amp; 0x07; int realDepth = bit24 &gt;&gt; 3; bmp.SetPixel(i, j, Color.FromArgb(realDepth)); } } pictureBox1.Image = bmp; </code></pre> <p>My output:</p> <p><img src="https://i.stack.imgur.com/hLJSu.png" alt="this is what it looks"></p> <p>I've played with it again. First I increased the brightness and contrast in Photoshop. So the rgb values are usable if you don't need the real depth values in millimeters.</p> <p><img src="https://i.stack.imgur.com/yJAHM.png" alt="increased brightness and contrast"></p> <p>Then I tried to get the 16bit values from image with WPF because the image is 16bit grayscale encoded.</p> <pre><code>Stream imageStreamSource = new FileStream("bKawM.png", FileMode.Open, FileAccess.Read, FileShare.Read); PngBitmapDecoder decoder = new PngBitmapDecoder(imageStreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default); BitmapSource bitmapSource = decoder.Frames[0]; int height = bitmapSource.PixelHeight; int width = bitmapSource.PixelWidth; int stride = width * ((bitmapSource.Format.BitsPerPixel + 7) / 8); byte[] bytes = new byte[height * stride]; bitmapSource.CopyPixels(bytes, stride, 0); for (int x = 0; x &lt; width; x++) { for (int y = 0; y &lt; height; y++) { byte low = bytes[y * stride + x + 0]; byte high = bytes[y * stride + x + 1]; ushort bit16 = (ushort)((high &lt;&lt; 8) | low); int user = bit16 &amp; 0x07; int realDepth = bit16 &gt;&gt; 3; } } </code></pre> <p>I created a new image with the depth values and it looked very strange. I don't find any information what data the image contains. I don't know if it contains the userdata (3 bits) or if the depth is converted somehow before saving to file.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload