NITE 1.5.1 - API Reference

XnVPushDetector Class Reference

#include <XnVPushDetector.h>

Inheritance diagram for XnVPushDetector:
Collaboration diagram for XnVPushDetector:

List of all members.

Public Types

typedef void(XN_CALLBACK_TYPE * PushCB )(XnFloat fVelocity, XnFloat fAngle, void *UserCxt)
typedef void(XN_CALLBACK_TYPE * StabilizedCB )(XnFloat fVelocity, void *UserCxt)

Public Member Functions

 XnVPushDetector (const XnChar *strName="XnVPushDetector")
 ~XnVPushDetector ()
void OnPrimaryPointCreate (const XnVHandPointContext *pContext, const XnPoint3D &ptFocus)
void OnPrimaryPointUpdate (const XnVHandPointContext *pContext)
XnCallbackHandle RegisterPush (void *cxt, PushCB pCB)
XnCallbackHandle RegisterStabilized (void *cxt, StabilizedCB pCB)
void UnregisterPush (XnCallbackHandle handle)
void UnregisterStabilized (XnCallbackHandle handle)
XnUInt32 GetPushDuration () const
void Reset ()
XnFloat GetPushImmediateMinimumVelocity () const
XnUInt32 GetPushImmediateDuration () const
XnUInt32 GetPushImmediateOffset () const
XnFloat GetPushPreviousMinimumVelocity () const
XnUInt32 GetPushPreviousDuration () const
XnUInt32 GetPushPreviousOffset () const
XnFloat GetPushMaximumAngleBetweenImmediateAndZ () const
XnFloat GetPushMinimumAngleBetweenImmediateAndPrevious () const
XnFloat GetStableMaximumVelocity () const
XnUInt32 GetStableDuration () const
void SetPushImmediateMinimumVelocity (XnFloat fVelocity)
void SetPushImmediateDuration (XnUInt32 nDuration)
void SetPushImmediateOffset (XnUInt32 nOffset)
void SetPushPreviousMinimumVelocity (XnFloat fVelocity)
void SetPushPreviousDuration (XnUInt32 nDuration)
void SetPushPreviousOffset (XnUInt32 nOffset)
void SetPushMaximumAngleBetweenImmediateAndZ (XnFloat fAngle)
void SetPushMinimumAngleBetweenImmediateAndPrevious (XnFloat fAngle)
void SetStableMaximumVelocity (XnFloat fVelocity)
void SetStableDuration (XnUInt32 nDuration)

Protected Member Functions

XnBool IsPushDetected (const XnV3DVector &vImmediateVelocity, const XnV3DVector &vPreviousVelocity, XnFloat &fZAngle)
XnBool IsStabilized (XnFloat fTime, XnFloat &fVelocity)
void UpdateLines (XnFloat fTime)
void AddPoint (const XnPoint3D &pt, XnFloat fTime)
XnFloat AngleBetweenVectors (const XnV3DVector &v1, const XnV3DVector &v2)
void PushDetected (XnFloat fVelocity, XnFloat fAngle)
void StabilizedDetected (XnFloat fVelocity)

Protected Attributes

XnBool m_bPushDetected
XnVPointBuffer * m_pPoints
XnFloat m_fPushImmediateMinVelocity
XnUInt32 m_nPushImmediateOffset
XnUInt32 m_nPushImmediateDuration
XnFloat m_fPushPreviousMinVelocity
XnUInt32 m_nPushPreviousOffset
XnUInt32 m_nPushPreviousDuration
XnFloat m_fPushMaxAngleFromZ
XnFloat m_fPushMinAngleImmediateAndPrevious
XnFloat m_fStableMaxVelocity
XnUInt32 m_nStableDuration
XnVFloatFloatSpecificEvent * m_pPushCBs
XnVFloatSpecificEvent * m_pStabilizedCBs

Detailed Description

A control that identifies pushes - moves in the z axis. The XnVPushDetector defines 2 events:

  • A push was identified
  • Stable state restored

Definition at line 25 of file XnVPushDetector.h.


Member Typedef Documentation

typedef void(XN_CALLBACK_TYPE * XnVPushDetector::PushCB)(XnFloat fVelocity, XnFloat fAngle, void *UserCxt)

Type for push event callback

Definition at line 32 of file XnVPushDetector.h.

typedef void(XN_CALLBACK_TYPE * XnVPushDetector::StabilizedCB)(XnFloat fVelocity, void *UserCxt)

Type for stable event callback

Definition at line 36 of file XnVPushDetector.h.


Constructor & Destructor Documentation

XnVPushDetector::XnVPushDetector ( const XnChar *  strName = "XnVPushDetector")

Construction.

Parameters:
[in]strNameName of the control, for log purposes.
XnVPushDetector::~XnVPushDetector ( )

Member Function Documentation

void XnVPushDetector::AddPoint ( const XnPoint3D &  pt,
XnFloat  fTime 
) [protected]
XnFloat XnVPushDetector::AngleBetweenVectors ( const XnV3DVector v1,
const XnV3DVector v2 
) [protected]
XnUInt32 XnVPushDetector::GetPushDuration ( ) const

The number of frames it takes to recognize the push. Effectively, this means the actual push started this number of frames ago.

XnUInt32 XnVPushDetector::GetPushImmediateDuration ( ) const

Get the time used to detect push, in ms

Returns:
the time
XnFloat XnVPushDetector::GetPushImmediateMinimumVelocity ( ) const

Get the minimum velocity in the time span to define as push, in m/s

Returns:
the velocity
XnUInt32 XnVPushDetector::GetPushImmediateOffset ( ) const

Get the the immediate timespan to skip, in ms

Returns:
the time
XnFloat XnVPushDetector::GetPushMaximumAngleBetweenImmediateAndZ ( ) const

Get the maximum angle between the immediate direction and the Z-axis, in degrees

Returns:
the angle
XnFloat XnVPushDetector::GetPushMinimumAngleBetweenImmediateAndPrevious ( ) const

Get the maximum angle between the immediate direction and the previous direction, in degrees

Returns:
the angle
XnUInt32 XnVPushDetector::GetPushPreviousDuration ( ) const

Get the time of the previous time span, in ms

Returns:
the time
XnFloat XnVPushDetector::GetPushPreviousMinimumVelocity ( ) const

Get the minimum velocity of the previous time span, in m/s

Returns:
the velocity
XnUInt32 XnVPushDetector::GetPushPreviousOffset ( ) const

Get the time to skip of the previous time span, in ms

Returns:
the time
XnUInt32 XnVPushDetector::GetStableDuration ( ) const

Get the time used to detect stable state, in ms

Returns:
the time
XnFloat XnVPushDetector::GetStableMaximumVelocity ( ) const

Get the maximum velocity in the time span to define as stable, in m/s

Returns:
the velocity
XnBool XnVPushDetector::IsPushDetected ( const XnV3DVector vImmediateVelocity,
const XnV3DVector vPreviousVelocity,
XnFloat &  fZAngle 
) [protected]
XnBool XnVPushDetector::IsStabilized ( XnFloat  fTime,
XnFloat &  fVelocity 
) [protected]
void XnVPushDetector::OnPrimaryPointCreate ( const XnVHandPointContext pContext,
const XnPoint3D &  ptFocus 
) [virtual]

Handle the creation of the primary point

Parameters:
[in]pContextThe hand context of the newly created primary point
[in]ptFocusThe point in which the session has started.

Reimplemented from XnVPointControl.

void XnVPushDetector::OnPrimaryPointUpdate ( const XnVHandPointContext pContext) [virtual]

called when the primary point is updated. This will cause the algorithm to look for pushes.

Parameters:
[in]pContextThe hand context of the updated primary point

Reimplemented from XnVPointControl.

void XnVPushDetector::PushDetected ( XnFloat  fVelocity,
XnFloat  fAngle 
) [protected]
XnCallbackHandle XnVPushDetector::RegisterPush ( void *  cxt,
PushCB  pCB 
)

Register to the push event

Parameters:
[in]cxtThe User's context
[in]pCBthe callback to be called when the event is invoked
Returns:
A handle, to allow unregistration
XnCallbackHandle XnVPushDetector::RegisterStabilized ( void *  cxt,
StabilizedCB  pCB 
)

Register to the stable event

Parameters:
[in]cxtThe User's context
[in]pCBthe callback to be called when the event is invoked
Returns:
A handle, to allow unregistration
void XnVPushDetector::Reset ( )

Start push detection over from scratch.

void XnVPushDetector::SetPushImmediateDuration ( XnUInt32  nDuration)

Change the time used to detect push. Default is 240ms

Returns:
the time
void XnVPushDetector::SetPushImmediateMinimumVelocity ( XnFloat  fVelocity)

Change the minimum velocity in the time span to define as push. Default is 0.33 m/s

Returns:
the velocity
void XnVPushDetector::SetPushImmediateOffset ( XnUInt32  nOffset)

Change the the immediate timespan to skip. Default is 0ms

Returns:
the time
void XnVPushDetector::SetPushMaximumAngleBetweenImmediateAndZ ( XnFloat  fAngle)

Change the maximum angle between the immediate direction and the Z-axis. Default is 30 degrees

Returns:
the angle
void XnVPushDetector::SetPushMinimumAngleBetweenImmediateAndPrevious ( XnFloat  fAngle)

Change the maximum angle between the immediate direction and the previous direction. Default is 20 degrees

Returns:
the angle
void XnVPushDetector::SetPushPreviousDuration ( XnUInt32  nDuration)

Change the time of the previous time span. Default is 150 ms

Returns:
the time
void XnVPushDetector::SetPushPreviousMinimumVelocity ( XnFloat  fVelocity)

Change the minimum velocity of the previous time span. Default is 0.17 m/s

Returns:
the velocity
void XnVPushDetector::SetPushPreviousOffset ( XnUInt32  nOffset)

Change the time to skip of the previous time span. Default is 240ms

Returns:
the time
void XnVPushDetector::SetStableDuration ( XnUInt32  nDuration)

Get the time used to detect stable state. Default is 360 ms

Returns:
the time
void XnVPushDetector::SetStableMaximumVelocity ( XnFloat  fVelocity)

Change the maximum velocity in the time span to define as stable. Default is 0.13 m/s

Returns:
the velocity
void XnVPushDetector::StabilizedDetected ( XnFloat  fVelocity) [protected]
void XnVPushDetector::UnregisterPush ( XnCallbackHandle  handle)

Unregister from the push event

Parameters:
[in]handleThe handle provided on registration.
void XnVPushDetector::UnregisterStabilized ( XnCallbackHandle  handle)

Unregister from the stable event

Parameters:
[in]handleThe handle provided on registration.
void XnVPushDetector::UpdateLines ( XnFloat  fTime) [protected]

Member Data Documentation

Definition at line 240 of file XnVPushDetector.h.

Definition at line 244 of file XnVPushDetector.h.

Definition at line 252 of file XnVPushDetector.h.

Definition at line 253 of file XnVPushDetector.h.

Definition at line 248 of file XnVPushDetector.h.

Definition at line 255 of file XnVPushDetector.h.

Definition at line 246 of file XnVPushDetector.h.

Definition at line 245 of file XnVPushDetector.h.

Definition at line 250 of file XnVPushDetector.h.

Definition at line 249 of file XnVPushDetector.h.

XnUInt32 XnVPushDetector::m_nStableDuration [protected]

Definition at line 256 of file XnVPushDetector.h.

XnVPointBuffer* XnVPushDetector::m_pPoints [protected]

Definition at line 242 of file XnVPushDetector.h.

XnVFloatFloatSpecificEvent* XnVPushDetector::m_pPushCBs [protected]

Definition at line 262 of file XnVPushDetector.h.

XnVFloatSpecificEvent* XnVPushDetector::m_pStabilizedCBs [protected]

Definition at line 263 of file XnVPushDetector.h.


The documentation for this class was generated from the following file: