ofxOpenNI + crude depths

Hey

I’ve setup a quick project to detect number of users and depth of each user in front of my kinect.
I’m using this fork of ofxOpenNI… https://github.com/gameoverhack/ofxOpenNI

My strategy was to use this to detect users, and then iterate through each user to find the depth of that user. The only way I can see how to do this is to test for an individual limbs.

Quite often the entire user returns as NULL, and there is no information for the skeleton. When I do get values for the skeleton, they print out to be 0. All I really need is a crude depth for the whole body, rather than individual skeleton points.

Am I missing a really easy way to do this?

Thanks

P

  
if (isTracking) {  
			numberUsers = recordUser.getNumberOfTrackedUsers();  
		}  
		  
		clearBundle();  
		if (numberUsers > 0) {  
			  
			// OSC out the number of users found  
			addMessage("/found", numberUsers);  
			  
			// iterate through number of tracked users    
			for (int user = 0; user < numberUsers; user++) {    
				  
				// get ref to a tracked user    
				ofxTrackedUser * trackedUser = recordUser.getTrackedUser(user);    
				  
				if (trackedUser != NULL) {    
					int right_upper_torsoX = trackedUser->right_upper_torso.position[0].X;    
					int right_upper_torsoY = trackedUser->right_upper_torso.position[0].Y;    
					int right_upper_torsoZ = trackedUser->right_upper_torso.position[0].Z;    
					  
					addMessage("/" + ofToString(user) + "/right_upper_torso/X/", right_upper_torsoX);  
					addMessage("/" + ofToString(user) + "/right_upper_torso/Y/", right_upper_torsoY);  
					addMessage("/" + ofToString(user) + "/right_upper_torso/Z/", right_upper_torsoZ);  
  
				}  
			}    
			  
			  
		} else {  
			  
			// tell OSC there are no users  
			addMessage("/found", 0);  
			  
		}  
		sendBundle();		  
  

Try float instead of int on right_upper_torsoX.

If I remember rightly, you only get position info if the user is tracked, i.e. they’ve done the calibration pose.

It might be worth looking at arturos version of ofxOpenNI2 anyway as he has changed quite a bit
http://forum.openframeworks.cc/t/ofxopenni2/7620/0

Also I don’t know if this will work yet as means updating the addon, but…

“New unstable NITE release 1.5.0.2 - No calibration pose needed!”
https://groups.google.com/group/openni-dev/browse-thread/thread/570380583bdb02e0