OpenNI 1.5.4: User Generator

OpenNI

Modules

 Skeleton Capability
 Pose Detection Capability
 Hand Touching FOV Edge Capability

Functions

XN_C_API XnStatus XN_C_DECL xnCreateUserGenerator (XnContext *pContext, XnNodeHandle *phUserGenerator, XnNodeQuery *pQuery, XnEnumerationErrors *pErrors)
XN_C_API XnUInt16 XN_C_DECL xnGetNumberOfUsers (XnNodeHandle hInstance)
XN_C_API XnStatus XN_C_DECL xnGetUsers (XnNodeHandle hInstance, XnUserID *pUsers, XnUInt16 *pnUsers)
XN_C_API XnStatus XN_C_DECL xnGetUserCoM (XnNodeHandle hInstance, XnUserID user, XnPoint3D *pCoM)
XN_C_API XnStatus XN_C_DECL xnGetUserPixels (XnNodeHandle hInstance, XnUserID user, XnSceneMetaData *pScene)
XN_C_API XnStatus XN_C_DECL xnRegisterUserCallbacks (XnNodeHandle hInstance, XnUserHandler NewUserCB, XnUserHandler LostUserCB, void *pCookie, XnCallbackHandle *phCallback)
XN_C_API void XN_C_DECL xnUnregisterUserCallbacks (XnNodeHandle hInstance, XnCallbackHandle hCallback)
XN_C_API XnStatus XN_C_DECL xnRegisterToUserExit (XnNodeHandle hInstance, XnUserHandler handler, void *pCookie, XnCallbackHandle *phCallback)
XN_C_API void XN_C_DECL xnUnregisterFromUserExit (XnNodeHandle hInstance, XnCallbackHandle hCallback)
XN_C_API XnStatus XN_C_DECL xnRegisterToUserReEnter (XnNodeHandle hInstance, XnUserHandler handler, void *pCookie, XnCallbackHandle *phCallback)
XN_C_API void XN_C_DECL xnUnregisterFromUserReEnter (XnNodeHandle hInstance, XnCallbackHandle hCallback)

Detailed Description

A User Generator node is a Generator that identifies a user in the scene. It supports all Generator functions, and adds additional functions.


Function Documentation

XN_C_API XnStatus XN_C_DECL xnCreateUserGenerator ( XnContext pContext,
XnNodeHandle phUserGenerator,
XnNodeQuery pQuery,
XnEnumerationErrors pErrors 
)

Creates a user generator.

Parameters:
pContext[in] The context in which to create the user generator.
phUserGenerator[out] A handle to the created user generator.
pQuery[in] Optional. Can be used to select which user generator to create. If not specified, this function may create any user generator that is available.
pErrors[in] Optional. If provided, will be filled with information about user generators that could not be created.
XN_C_API XnUInt16 XN_C_DECL xnGetNumberOfUsers ( XnNodeHandle  hInstance)

Get current number of users.

Parameters:
hInstance[in] A handle to the instance
XN_C_API XnStatus XN_C_DECL xnGetUserCoM ( XnNodeHandle  hInstance,
XnUserID  user,
XnPoint3D pCoM 
)

Get the center of mass of a user.

Parameters:
hInstance[in] A handle to the instance
user[in] The user for which to get the center of mass
pCoM[out] The center of mass
XN_C_API XnStatus XN_C_DECL xnGetUserPixels ( XnNodeHandle  hInstance,
XnUserID  user,
XnSceneMetaData pScene 
)

Get the pixels that belong to a user.

The output is in a XnSceneMetaData object, holding a map of the pixels of the scene, with the user's label as the value in the places corresponding with the user's pixels. Pixels outside the user will not contain the user's ID. ID 0 means a request for the pixels of all users. In this case, the background will get the label 0.

Parameters:
hInstance[in] A handle to the instance
user[in] The user for which to get the pixels
pScene[out] XnSceneMetaData object, that holds the pixels of the user
XN_C_API XnStatus XN_C_DECL xnGetUsers ( XnNodeHandle  hInstance,
XnUserID pUsers,
XnUInt16 *  pnUsers 
)

Get the current users.

Parameters:
hInstance[in] A handle to the instance
pUsers[out] Preallocated memory for the users
pnUsers[in,out] The size of the preallocated memory. Changes to the number of users
XN_C_API XnStatus XN_C_DECL xnRegisterToUserExit ( XnNodeHandle  hInstance,
XnUserHandler  handler,
void *  pCookie,
XnCallbackHandle phCallback 
)

Register to when the user exits the scene (but not lost yet)

Parameters:
hInstance[in] A handle to the instance
handler[in] Callback to be called when a user leaves the scene
pCookie[in] User's cookie, to be delivered to the callbacks
phCallback[out] The handle to this callback, to allow unregistration
XN_C_API XnStatus XN_C_DECL xnRegisterToUserReEnter ( XnNodeHandle  hInstance,
XnUserHandler  handler,
void *  pCookie,
XnCallbackHandle phCallback 
)

Register to when a user re-enters the scene after exiting.

Parameters:
hInstance[in] A handle to the instance
handler[in] Callback to be called when a user leaves the scene
pCookie[in] User's cookie, to be delivered to the callbacks
phCallback[out] The handle to this callback, to allow unregistration
XN_C_API XnStatus XN_C_DECL xnRegisterUserCallbacks ( XnNodeHandle  hInstance,
XnUserHandler  NewUserCB,
XnUserHandler  LostUserCB,
void *  pCookie,
XnCallbackHandle phCallback 
)

Register to user callbacks.

Parameters:
hInstance[in] A handle to the instance
NewUserCB[in] Callback to be called when a new user is identified
LostUserCB[in] Callback to be called when an existing user is no longer identified
pCookie[in] User's cookie, to be delivered to the callbacks
phCallback[out] The handle to these callbacks, to allow unregistration
XN_C_API void XN_C_DECL xnUnregisterFromUserExit ( XnNodeHandle  hInstance,
XnCallbackHandle  hCallback 
)

Unregister from when a user exits the scene.

Parameters:
hInstance[in] A handle to the instance
hCallback[in] The handle received from registration
XN_C_API void XN_C_DECL xnUnregisterFromUserReEnter ( XnNodeHandle  hInstance,
XnCallbackHandle  hCallback 
)

Unregister from when a user re-enters the scene.

Parameters:
hInstance[in] A handle to the instance
hCallback[in] The handle received from registration
XN_C_API void XN_C_DECL xnUnregisterUserCallbacks ( XnNodeHandle  hInstance,
XnCallbackHandle  hCallback 
)

Unregister from user callbacks.

Parameters:
hInstance[in] A handle to the instance
hCallback[in] The handle received from registration
Generated on Wed May 16 2012 10:16:06 for OpenNI 1.5.4 by   doxygen 1.7.5.1