jit.openni: user ID problems
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!
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:
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 640×480 matrix.
I am trying to figure out how to improve this.
----------begin_max5_patcher---------- 1132.3ocyY0rbhiCD9L7TnxG2JqKIY4+1SYtMu.yos1hx.BPYLRdsEIryTy6 9J0B6PHXvvJbsgJ3HYI4t+5t+5tc94zIAyU64MAn+.8mnIS94zISforSL4v3 IAaK1unrnAVVfj+lZ9KAO4tkluWCS+hPGppPOa982PO+ZQIhFiaW0JkT2H9A 2tRBMDeXZ4tsBYIWCGL8vjUE5EaDx0yp4KzNAiRRRLaBEEY2q4DxrWn3PL5u d+nT6zmdVtoz+SE2cPVob11BcsXevSnfftsKVBJgQw9cZ5wRsrXKr2fuTKJJ Cr23WSmZ+5oAhWVfo5Mgbo5s1Ctpl2vk5BsPIOVMiwQVEKlgAskBWnrSzy2g Lx.fL2EJKILw7SJ0.eYw2Nv0ObkeOfhVsdcIO3FUJRFi3r7rVGfK5FP5SaDR 84UlDVmMpn1X5075YbYw7RXm36PS6Ib4uMmcsBEw7THBICevPCPSR78BMyKj q6Aah8afwEIR3Ro.8rUtPqJUE5HpgZYmtZmd1Rdkdy1hJDoaJw1h07Slp1NF 2MdWCu9iqnYAWxmYNcU8Qqq46bCfnjGuvCSMSUKZCas6na9UJyQqQjVcoTH4 KT6j5iMZCw.SFfANELvwY.GXT+V3jgwAN7Q8SADcVGiuxKekqEKJtGmis7lF iM8SdG3PDKz.9m4iuhjxI4gzXSLDwksIOEFRxt8foyCWX+FGsPscqws7SPkw qD8kcZkwBZzPz2LA.nFiG6Bq+6kcUqWOG365.u+qNu4XZXZ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