nagyistoce / simple-openni

Automatically exported from code.google.com/p/simple-openni
0 stars 0 forks source link

How to get only one Scene user #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, 

I have been using this wrapper all summer. I love it. Anyways, I have a quick 
and probably simple question. In the Scene examples, can I make it so only one 
user can be detected and that user is always blue? And if so, how?

Thanks!

Original issue reported on code.google.com by Mikeshi...@gmail.com on 21 Jul 2011 at 5:07

GoogleCodeExporter commented 9 years ago
Hi,
the function getUsersPixels returns an array with the user's id for each pixel, 
i.e. if there are 2 people on the scene, you'll get an array filled with 0,1 
and 2. The 0s will mean that these pixels are not showing a user, the 1s will 
be the 1st user's pixels, and the 2s, well you guess what they mean.

That way, you just have to loop over this array to get which player is shown on 
which pixel. you just have to filter this array to get only the 1 values, then 
you can render this array or use it as a mask.

Original comment by bkuperb...@gmail.com on 18 Aug 2011 at 9:13

GoogleCodeExporter commented 9 years ago

Original comment by m...@paus.ch on 5 May 2012 at 8:40