Socket
Socket
Sign inDemoInstall

openni

Package Overview
Dependencies
0
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    openni

OpenNI bindings in Node.js.


Version published
Weekly downloads
7
increased by600%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

node-openni

OpenNI bindings in Node.js.

Supports multiple users.

Install

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

Test

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

Use

Create Context

var OpenNI = require('openni');

var context = OpenNI();

Register for user events:

[
  'newuser',
  'userexit',
  'lostuser',
  'posedetected',
  'calibrationstart',
  'calibrationsucceed',
  'calibrationfail'
].forEach(function(eventType) {
  context.on(eventType, function(userId) {
    console.log('User %d emitted event: %s', userId, eventType);
  });
});

Register for joint events

[
  "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 Context

// Close the context to exit

process.on('SIGINT', function() {
  context.close();
  process.exit();
});

Specify Joints

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');
}

Licence

MIT

FAQs

Last updated on 28 Jul 2013

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc