OpenNI bindings in Node.js.
Supports multiple users.
Ping the author if you're interested!
Install libusb and OpenNI following the platform-specific instructions at https://github.com/OpenNI/OpenNI.
(If you're having trouble with this installation, some users have reported that the simple-openni package installs these dependencies successfully: https://code.google.com/p/simple-openni/wiki/Installation )
Then you will have to fork this repo:
$ cd node-openni
$ node-gyp configure build
Plug in your kinect.
Run:
$ node test/base
Stay in the surrender position in front of the camera, a couple of meters away. After you're synced you should see
var OpenNI = require('openni');
var context = OpenNI();
[
'newuser',
'userexit',
'lostuser',
'posedetected',
'calibrationstart',
'calibrationsucceed',
'calibrationfail'
].forEach(function(eventType) {
context.on(eventType, function(userId) {
console.log('User %d emitted event: %s', userId, eventType);
});
});
[
"head",
"neck",
"torso",
"waist",
"left_collar",
"left_shoulder",
"left_elbow",
"left_wrist",
"left_hand",
"left_fingertip",
"right_collar",
"right_shoulder",
"right_elbow",
"right_wrist",
"right_hand",
"right_fingertip",
"left_hip",
"left_knee",
"left_ankle",
"left_foot",
"right_hip",
"right_knee",
"right_ankle",
"right_foot"
].forEach(function(jointName) {
context.on(jointName, function(user, x, y, z) {
console.log(jointName + ' of user %d moved to (%d, %d, %d)', user, x, y, z);
});
});
// Close the context to exit
process.on('SIGINT', function() {
context.close();
process.exit();
});
You can specify exactly which joints you want to be tracked:
context.setJoints(['head', 'left_hand', 'right_hand']);
#Gestures Two gestures added: Wave and Click. ##Gesture Callbacks
context.on('Wave', function(gesture) {
console.log('wave');
});
context.on('Click', function(gesture) {
console.log('click');
}
MIT