0

I'm using simpleOpenNI with the Kinect. I have an array of 5 colors and a certain number of people (12-13) that will come in front of the kinect one by one. I need to relate a single color to a single person. When the index of the array of colors will arrive at 5, it will be reset to 0. My problem is that I cant' do something like 'new user = index++' because the userId doesn't seem to change everytime a person exit the kinect space and a new one enters in. My problem is that I don't understand when/where a new user is detected.

I think I should do something in this part of code but not sure where

void draw()
{
  // update the cam
  context.update();

  // draw depthImageMap
  image(context.rgbImage(),0,0,200, 200);

  // draw the skeleton if it's available
  int[] userList = context.getUsers();
  for(int i=0;i<userList.length;i++)
  {
    if(context.isTrackingSkeleton(userList[i]))
    {
      stroke(userClr[ (userList[i] - 1) % userClr.length ] );
      drawSkeleton(userList[i]);
      draw_line(xL, yL, oldXL, oldYL, xR, yR, oldXR, oldYR);
    }
  }

}
SF1
  • 469
  • 1
  • 6
  • 20

1 Answers1

1

The automatic scene segmentation in OpenNI is nice, but not perfect. Sometimes you'll notice parts of the background may merge with a user (if the background is complex) and the user detection is an estimation: it may not keep track of users entering/exiting the scene correctly.

Even with a user or two, you'll notice the same person exiting and entering the scene may be assigned a different user id and the best thing is to manage users yourself.

This may not be trivial, but perhaps you can try OpenTSPS since it provides some of this functionality and it plays well with Processing

OpenTSPS Person Events

OpenTSPS Basics

OpenTSPS Advanced

George Profenza
  • 50,687
  • 19
  • 144
  • 218