Example #1
0
// Define hand & gesture recognition callbacks
void XN_CALLBACK_TYPE Gesture_Recognized(
    xn::GestureGenerator& generator,
    const XnChar* strGesture,
    const XnPoint3D* pIDPosition,
    const XnPoint3D* pEndPosition,
    void* pCookie)
{
  gesture_generator.RemoveGesture(strGesture);
  hands_generator.StartTracking(*pEndPosition);
}
Example #2
0
void XN_CALLBACK_TYPE Kinect::GestureRecognized( xn::GestureGenerator& generator,const XnChar* strGesture,
	const XnPoint3D* pIDPosition,const XnPoint3D* pEndPosition,void* pCookie )
{
	Kinect * kinect = ((Kinect *)pCookie);
	if( strcmp( strGesture, "Wave" ) == 0 )
	{
		mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
		mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
	}
	else if( strcmp( strGesture, "RaiseHand" ) == 0 )
	{
		generator.RemoveGesture(strGesture);
		kinect->m_HandsGenerator.StartTracking( *pEndPosition );
	}
}
//gesture callbacks
void XN_CALLBACK_TYPE Gesture_Recognized(xn::GestureGenerator& generator, const XnChar* strGesture, const XnPoint3D* pIDPosition, const XnPoint3D* pEndPosition, void* pCookie) {
	printf("{\"gesture\":{\"type\":\"%s\"}, \"elapsed\":%.3f}}\n", strGesture, clockAsFloat(last));
	gestureGenerator.RemoveGesture(strGesture);
	handsGenerator.StartTracking(*pEndPosition);
}
void GestureGenerator_RemoveGesture_wrapped(xn::GestureGenerator& self, std::string gesture) {
    checkValid(self);
    
    check( self.RemoveGesture(gesture.c_str()) );
}