jit.openni: user ID problems
Hi,
I am new to Kinect and jit.openni, so hopefully there is some easy solution to the problem I am facing...
The thing is that I am using Kinect for some interactive installation and I would like that it would work for only 4 users. So that skeleton of user 1 would affect certain parameters, skeleton of user 2 some other parameters etc. And the users should be some random folks walking around and interacting with the installation.
Now the problem is that I can't understand the logic behind assigning ID numbers. If I alone step in front of Kinect few times, once I'll be user 1, next time I'll be user 2, then again user 1, then user 3, then user 4, then again user 2... And if there are for instance 3 users interfering, their ID's can be basically "any" number.
So what I need is that if there is only one user present, it can have ID only 1. And if there are 4 users present, they can have IDs only between 1 and 4, so I can assign their skeleton data to certain parameters.
Should I go for some other XML file (currently I am using jit.openni_config.xml) or should I mess around with "I see", "I lost" etc. messages?
Thanks for any hint!
Tadej
Or in other words, how to count users?:)
If I step few times in front of Kinect, there is "I see 1", then "I see 2", "I see 3", then again ""I see 1"...?
OpenNI has its own internal logic for assigning userIDs. I recommend you reference the jit.openni wiki and the OpenNI documentation on what details were published.
In short, the IDs will change. Once a user leaves the scene and is no longer recognized, the ID is unlikely to be reassigned to that human or even the next user which enters the scene.
You will need to have/write your own logic to keep track of how many users are currently in the scene. And then do whatever you want with it. You have all the data you need give the "user" and/or "skel" messages. Now...you need to count increment/decrement.
I found out that it takes about 10 seconds before "I lost user ID" message appears. That means that if I alone go in front of Kinect and away from Kinect 3 times in 10 seconds, my counter says there are 3 users - because there was no "I lost" or "exit" messages in that 10 seconds. So basically I can not count people in real time, because always I have to wait 10 seconds for correct number of users. And when you have many people wondering around its practically impossible to count people, at least using "i see", "i lost", "exit" and "reenter" messages. "I see" works fine but "i lost" and "exit" has huge delay...which I guess could be very useful but not in my situation.
So is there any other way of counting people? What parameters would you take if you would have to count people? I was also trying by switching off the user if the stream of data from the user was stoped, but somehow I wasn't successful...
And thanks a lot for your help so far!
I found some very helpful info here:
Basically if you change "ServerNoClientsTimeout" parameter in file GlobalDefaultsKinect.ini from the default 10000 to something less, then the counting seems to work as I was hoping :)
Now as I will have the number of users in front of Kinect I think the rest should be doable...
well, as it looks, “ServerNoClientsTimeout” parameter affects only "exituser" message and not "I lost". And "exituser" is very unreliable. Even if users leaves at the sides, it does not always trigger "exituser" event. And then again we have to wait some seconds for "lost user" event...
It seems there is no solution at the moment for reliable counting...
PS: there is also one topic concerning this subject:
Hey, T
Interesting research you are doing there. I found a workaround solution to the same problem.
Clearly not the best, but it works. It acts better then exit_user or lost_user.
It analyses the image coming out of jit.openni usermap genetaror output. One problem I have is figuring out how to process a 640x480 matrix.
I am trying to figure out how to improve this.