none
Color values from FusionColorImageFrame RRS feed

  • Question

  • Hello!

    I'm using Kinect SDK 1.8 and studying the Kinect Fusion Head Scanning-WPF sample code.

    I want to change the color values of the reconstructed face. I think the way to do this is to change the FusionColorImageFrame image after CalculatePointCloud method.

    I have not found a way to change the pixel value directly from that image (is it right?). So, I used CopyPixelDataTo() to copy the image content to an int array. I have made a test and it is changing the pixel values as I wanted.

    The problem is the pixel value found in this int array. Black pixel have value of -16777216.

    How can I convert this number to RGB and how can I convert a RGB to this kind of number (so that I can use the color values that I want with this array)

    Thanks!

    Monday, October 21, 2013 11:04 PM

Answers

  • Correct, you can copy the data out of Fusion, but you can only integrate color through a color frame with depth data. With respect to reading RGB data from an int, you need to read the byte values

    int value = -1677216
    
    byte R = (value & 0xff) >> 24;
    byte G = (value & 0x00ff) >> 16;
    byte B = (value & 0x0000ff) >> 8;
    byte A = (value & 0x000000ff); // typically 255 or 0

    Carmine Sirignano - MSFT

    Tuesday, October 22, 2013 11:12 PM