#include <XnVPushDetector.h>


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 |
A control that identifies pushes - moves in the z axis. The XnVPushDetector defines 2 events:
Definition at line 25 of file XnVPushDetector.h.
| 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.
| XnVPushDetector::XnVPushDetector | ( | const XnChar * | strName = "XnVPushDetector" |
) |
Construction.
| [in] | strName | Name of the control, for log purposes. |
| XnVPushDetector::~XnVPushDetector | ( | ) |
| 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
| XnFloat XnVPushDetector::GetPushImmediateMinimumVelocity | ( | ) | const |
Get the minimum velocity in the time span to define as push, in m/s
| XnUInt32 XnVPushDetector::GetPushImmediateOffset | ( | ) | const |
Get the the immediate timespan to skip, in ms
| XnFloat XnVPushDetector::GetPushMaximumAngleBetweenImmediateAndZ | ( | ) | const |
Get the maximum angle between the immediate direction and the Z-axis, in degrees
| XnFloat XnVPushDetector::GetPushMinimumAngleBetweenImmediateAndPrevious | ( | ) | const |
Get the maximum angle between the immediate direction and the previous direction, in degrees
| XnUInt32 XnVPushDetector::GetPushPreviousDuration | ( | ) | const |
Get the time of the previous time span, in ms
| XnFloat XnVPushDetector::GetPushPreviousMinimumVelocity | ( | ) | const |
Get the minimum velocity of the previous time span, in m/s
| XnUInt32 XnVPushDetector::GetPushPreviousOffset | ( | ) | const |
Get the time to skip of the previous time span, in ms
| XnUInt32 XnVPushDetector::GetStableDuration | ( | ) | const |
Get the time used to detect stable state, in ms
| XnFloat XnVPushDetector::GetStableMaximumVelocity | ( | ) | const |
Get the maximum velocity in the time span to define as stable, in m/s
| 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
| [in] | pContext | The hand context of the newly created primary point |
| [in] | ptFocus | The 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.
| [in] | pContext | The 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
| [in] | cxt | The User's context |
| [in] | pCB | the callback to be called when the event is invoked |
| XnCallbackHandle XnVPushDetector::RegisterStabilized | ( | void * | cxt, | |
| StabilizedCB | pCB | |||
| ) |
Register to the stable event
| [in] | cxt | The User's context |
| [in] | pCB | the callback to be called when the event is invoked |
| void XnVPushDetector::Reset | ( | ) |
Start push detection over from scratch.
| void XnVPushDetector::SetPushImmediateDuration | ( | XnUInt32 | nDuration | ) |
Change the time used to detect push. Default is 240ms
| void XnVPushDetector::SetPushImmediateMinimumVelocity | ( | XnFloat | fVelocity | ) |
Change the minimum velocity in the time span to define as push. Default is 0.33 m/s
| void XnVPushDetector::SetPushImmediateOffset | ( | XnUInt32 | nOffset | ) |
Change the the immediate timespan to skip. Default is 0ms
| void XnVPushDetector::SetPushMaximumAngleBetweenImmediateAndZ | ( | XnFloat | fAngle | ) |
Change the maximum angle between the immediate direction and the Z-axis. Default is 30 degrees
| void XnVPushDetector::SetPushMinimumAngleBetweenImmediateAndPrevious | ( | XnFloat | fAngle | ) |
Change the maximum angle between the immediate direction and the previous direction. Default is 20 degrees
| void XnVPushDetector::SetPushPreviousDuration | ( | XnUInt32 | nDuration | ) |
Change the time of the previous time span. Default is 150 ms
| void XnVPushDetector::SetPushPreviousMinimumVelocity | ( | XnFloat | fVelocity | ) |
Change the minimum velocity of the previous time span. Default is 0.17 m/s
| void XnVPushDetector::SetPushPreviousOffset | ( | XnUInt32 | nOffset | ) |
Change the time to skip of the previous time span. Default is 240ms
| void XnVPushDetector::SetStableDuration | ( | XnUInt32 | nDuration | ) |
Get the time used to detect stable state. Default is 360 ms
| void XnVPushDetector::SetStableMaximumVelocity | ( | XnFloat | fVelocity | ) |
Change the maximum velocity in the time span to define as stable. Default is 0.13 m/s
| void XnVPushDetector::StabilizedDetected | ( | XnFloat | fVelocity | ) | [protected] |
| void XnVPushDetector::UnregisterPush | ( | XnCallbackHandle | handle | ) |
Unregister from the push event
| [in] | handle | The handle provided on registration. |
| void XnVPushDetector::UnregisterStabilized | ( | XnCallbackHandle | handle | ) |
Unregister from the stable event
| [in] | handle | The handle provided on registration. |
| void XnVPushDetector::UpdateLines | ( | XnFloat | fTime | ) | [protected] |
XnBool XnVPushDetector::m_bPushDetected [protected] |
Definition at line 240 of file XnVPushDetector.h.
XnFloat XnVPushDetector::m_fPushImmediateMinVelocity [protected] |
Definition at line 244 of file XnVPushDetector.h.
XnFloat XnVPushDetector::m_fPushMaxAngleFromZ [protected] |
Definition at line 252 of file XnVPushDetector.h.
XnFloat XnVPushDetector::m_fPushMinAngleImmediateAndPrevious [protected] |
Definition at line 253 of file XnVPushDetector.h.
XnFloat XnVPushDetector::m_fPushPreviousMinVelocity [protected] |
Definition at line 248 of file XnVPushDetector.h.
XnFloat XnVPushDetector::m_fStableMaxVelocity [protected] |
Definition at line 255 of file XnVPushDetector.h.
XnUInt32 XnVPushDetector::m_nPushImmediateDuration [protected] |
Definition at line 246 of file XnVPushDetector.h.
XnUInt32 XnVPushDetector::m_nPushImmediateOffset [protected] |
Definition at line 245 of file XnVPushDetector.h.
XnUInt32 XnVPushDetector::m_nPushPreviousDuration [protected] |
Definition at line 250 of file XnVPushDetector.h.
XnUInt32 XnVPushDetector::m_nPushPreviousOffset [protected] |
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.
1.7.1