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