Skip to content
jmendeth edited this page Feb 14, 2012 · 4 revisions

Here's the complete list of features exposed:

Classes

  • Context: represents a Context in OpenNI.
  • ProductionNode: represents a production node.
    • Generator: represents a node that generates new data.
      • MapGenerator: these kind of nodes generate data in form of 2D maps.
        • ImageGenerator: generates images (color maps) readen from a device.
        • DepthGenerator: generates depth maps readen from a device.
      • UserGenerator: it's able to detect different players that interact in the scene, basing on a provided depth map.
      • GestureGenerator: it's able to detect various gestures, normally arm gestures.
  • Capability: represents a capability supported by a specific production node.
    • PoseDetectionCapability: supported by user generators. It's able to detect specific poses from a user.
    • SkeletonCapability: supported by user generators. Once calibrated, it's able to track a user's skeleton (either all or a part of it).
  • Version: Carries a version of a program (though it's mainly used to contain an OpenNI version). It can be represented into text.
  • OpenNIError: it is thrown by any method when some kind of failure occurs. It contains the status which caused the error and provides methods to get its corresponding name or error message.

“Converted” classes

These classes, due to its simplicity, aren't directly exposed to Python. Instead, they are converted into simple tuples, sets, or lists.

  • XnUInt32XYPair: a pair of (unsigned) integers designing the X and Y coordinates of a 2D size, point, normal, ...
  • Xn3DVector: three floating-point numbers designing the X, Y and Z coordinate of a 3D point, normal, size, ...
  • XnRGB24Pixel: three (unsigned) bytes designing the red, green and blue components of a color.
  • XnMatrix3X3: an array of 9 floating-point numbers, designing a 3x3 matrix.

Other supported features

  1. Exception wrapping: this powerful feature checks the status returned by OpenNI methods, instead of returning it. If the status is different than XN_STATUS_OK, it throws an OpenNIError containing the status. This allows notable simplification of your Python code (having a single except vs. checking every status), and is also used in the Java wrapper.
  2. Callbacks: Allows you to register your own functions with OpenNI, so they will get called when OpenNI detects a certain event.
  3. Polymorphism: if you want to handle a particular type of node that is not currently exposed, PyOpenNI will pick the class that best matches its type.
  4. Version info: ability to lookup OpenNI version through version() and PyOpenNI version through bindings_version().

Enums

  • ProductionNodeType: the different types of production nodes.
  • PixelFormat: the different formats for every pixel in a map.
  • SkeletonJoint: the different joints in a skeleton.
  • SkeletonProfile: different profiles for the skeleton tracking (area to track, enabled joints, ...).
  • CalibrationStatus: indicates different status in the skeleton calibration process (the currently calibrating area, if the process succeeded or failed, ...)
  • DefResolution: contains common sizes / resolutions used for maps.

Documentation

Docstrings

Docstrings for the generated classes, methods and properties are enabled.
Some classes are fully documented, but there are still a lot of docstrings to add.
You can have a look at the docstrings through Python's help(...) system.

Samples

We have various samples to demostrate and introduce the user to PyOpenNI.
These can be found under the examples/ folder.

Want to start a PyOpenNI script quickly? Have also a look at examples/templates/.

Clone this wiki locally