none
Isolate player from kinect sensor point cloud which is connected to network RRS feed

  • Question

  • Hi,

    I have some doubts on rendering rgb,depth and bodyindex buffers from network machine sensor:-
    Actually i want to render rgb point cloud and clipped bodies of human,so for clipped body i need bodyindex buffer from network machine sensor.

    I am getting correct playerindex bytes for client machine sensor,from that i am able to isolate the human.But in the network machine sensor the playerindex data comes as unsigned char.

    void AcquireAndProcessBodyIndexFrame()
    {
    IBodyIndexFramePtr bodyIndexFrame;
    signed char* s2buffer;
    if (bodyIndexStreamer->AcquireLatestFrame(&bodyIndexFrame))
    {
    UINT bufferSize;
    bodyIndexFrame->AccessRawUnderlyingBuffer(&bufferSize, &s2buffer);
    unsigned char* output = bodyIndexFrameRenderBuffer;
    const signed char* bufferEnd = s2buffer + DEPTH_MULTICAST_WIDTHDEPTH_MULTICAST_HEIGHT;
    while(s2buffer < bufferEnd)
    {
    signed char index = *s2buffer;
    *output = color_mapping[3(index+1)+0];
     ++output;
    output = color_mapping[3(index+1)+1]; 
    ++output;
    output = color_mapping[3(index+1)+2];
     ++output;
    ++s2buffer;
    }
    indexSensor2buffer=reinterpret_cast(s2buffer);
    bodyIndexFrame.reset();
    }
    }




    void displayplayer()
    {
    p = pDepthS2SpaceBuffer[colorIndex];
    int depthX = static_cast(p.X );
    int depthY = static_cast(p.Y );
    if ((depthX >= 0 && depthX < 512) && (depthY >= 0 && depthY < 424))
    {
    BYTE player = indexSensor2buffer[depthX + (depthY * 512)];
    const CameraSpacePoint& rPt1 = pCSS2Points[colorIndex];
    xx =(i-pp_x)rPt1.Z/fl_x;
    yy = (j-pp_y)rPt1.Z/fl_y;
    zz=rPt1.Z;
    if (player != 0xff)
    {
    glColor4ub(pColorBuffer[4 * colorIndex], pColorBuffer[4 * colorIndex + 1], pColorBuffer[4 * colorIndex + 2], pColorBuffer[4 * colorIndex + 3]);
    glVertex3f(xx, -yy, rPt1.Z);
    } 
    }
    }


    but indexSensor2buffer returns 230,234,248 ... , it should be like this [-1,0,1,2,3,4,5] and [255(if no player)].

    I dont know why it is returning 230,234 instead of -1 ,0,1,2,3,4.

    Please help me to fix it.

    Thanks


    kirubha

    Thursday, July 2, 2015 3:24 PM