• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ xn::Context类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中xn::Context的典型用法代码示例。如果您正苦于以下问题:C++ Context类的具体用法?C++ Context怎么用?C++ Context使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Context类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: glutDisplay

// this function is called each frame
void glutDisplay (void)
{

	glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	// Setup the OpenGL viewpoint
	glMatrixMode(GL_PROJECTION);
	glPushMatrix();
	glLoadIdentity();

	xn::SceneMetaData sceneMD;
	xn::DepthMetaData depthMD;
	g_DepthGenerator.GetMetaData(depthMD);
	glOrtho(0, depthMD.XRes(), depthMD.YRes(), 0, -1.0, 1.0);

	glDisable(GL_TEXTURE_2D);

	if (!g_bPause)
	{
		// Read next available data
		g_Context.WaitAndUpdateAll();
	}

		// Process the data
		g_DepthGenerator.GetMetaData(depthMD);
		g_UserGenerator.GetUserPixels(0, sceneMD);
		DrawDepthMap(depthMD, sceneMD);

	glutSwapBuffers();
}
开发者ID:chazmatazz,项目名称:nestk,代码行数:31,代码来源:main.cpp


示例2: StartCapture

void StartCapture()
{
	char recordFile[256] = {0};
	time_t rawtime;
	struct tm *timeinfo;

	time(&rawtime);
	timeinfo = localtime(&rawtime);
	XnUInt32 size;
	xnOSStrFormat(recordFile, sizeof(recordFile)-1, &size,
		 "%d_%02d_%02d[%02d_%02d_%02d].oni",
		timeinfo->tm_year + 1900, timeinfo->tm_mon + 1, timeinfo->tm_mday, timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);

	if (g_pRecorder != NULL)
	{
		StopCapture();
	}

	XnStatus nRetVal = XN_STATUS_OK;
	g_pRecorder = new xn::Recorder;

	g_Context.CreateAnyProductionTree(XN_NODE_TYPE_RECORDER, NULL, *g_pRecorder);
	START_CAPTURE_CHECK_RC(nRetVal, "Create recorder");

	nRetVal = g_pRecorder->SetDestination(XN_RECORD_MEDIUM_FILE, recordFile);
	START_CAPTURE_CHECK_RC(nRetVal, "set destination");
	nRetVal = g_pRecorder->AddNodeToRecording(g_DepthGenerator, XN_CODEC_16Z_EMB_TABLES);
	START_CAPTURE_CHECK_RC(nRetVal, "add node");
	g_bRecord = true;
}
开发者ID:Such1337Hax0r,项目名称:python_kinect_socketio,代码行数:30,代码来源:main.cpp


示例3: glutDisplay

// this function is called each frame
void glutDisplay (void)
{

	glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	// Setup the OpenGL viewpoint
	glMatrixMode(GL_PROJECTION);
	glPushMatrix();
	glLoadIdentity();

	XnMapOutputMode mode;
	g_DepthGenerator.GetMapOutputMode(mode);
#ifdef USE_GLUT
	glOrtho(0, mode.nXRes, mode.nYRes, 0, -1.0, 1.0);
#elif defined(USE_GLES)
	glOrthof(0, mode.nXRes, mode.nYRes, 0, -1.0, 1.0);
#endif

	glDisable(GL_TEXTURE_2D);

	if (!g_bPause)
	{
		// Read next available data
		g_Context.WaitOneUpdateAll(g_DepthGenerator);
		// Update NITE tree
		g_pSessionManager->Update(&g_Context);
#ifdef USE_GLUT
		PrintSessionState(g_SessionState);
#endif
	}

#ifdef USE_GLUT
	glutSwapBuffers();
#endif
}
开发者ID:avinashb-sd,项目名称:MaestroRepo,代码行数:36,代码来源:main.cpp


示例4: glutDisplay

// this function is called each frame
void glutDisplay (void)
{
  // Read next available data
  g_Context.WaitAnyUpdateAll();
  // Process the data
  g_pSessionManager->Update(&g_Context);
  
  glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  
  // Setup the OpenGL viewpoint
  glMatrixMode(GL_PROJECTION);
  glPushMatrix();
  glLoadIdentity();
  
#ifdef USE_GLUT
  glOrtho(0, GL_WIN_SIZE_X, 0, GL_WIN_SIZE_Y, -1.0, 1.0);
#else
  glOrthof(0, GL_WIN_SIZE_X, 0, GL_WIN_SIZE_Y, -1.0, 1.0);
#endif
  
  glDisable(GL_TEXTURE_2D);
  
  // Draw the TrackPad
  DrowTrackPad();
  
#ifdef USE_GLUT
  glutSwapBuffers();
#endif
}
开发者ID:89grad,项目名称:Fish-Game,代码行数:30,代码来源:main.cpp


示例5: SetupIR

bool SetupIR(xn::Context& g_context)
{
	XnStatus nRetVal = XN_STATUS_OK;
	/*
	if ((nRetVal = g_ir.Create(g_context))!= XN_STATUS_OK)
	{
		printf("Could not create ir generator: %s\n", xnGetStatusString(nRetVal));
		return FALSE;
	}
	*/


	if ((nRetVal = g_context.FindExistingNode(XN_NODE_TYPE_IR, g_ir)) != XN_STATUS_OK)
	{
		fprintf(stderr,"Could not find ir sensor: %s\n", xnGetStatusString(nRetVal));
		return FALSE;
	}

	XnMapOutputMode mapMode;
	mapMode.nXRes = XN_VGA_X_RES;
	mapMode.nYRes = XN_VGA_Y_RES;
	mapMode.nFPS = 30;
	if ((nRetVal = g_ir.SetMapOutputMode(mapMode)) != XN_STATUS_OK)
	{
		fprintf(stderr,"Could not set ir mode: %s\n", xnGetStatusString(nRetVal));
		return FALSE;
	}

	g_ir.GetMetaData(g_irMD);
	return TRUE;
}
开发者ID:Topographic0cean,项目名称:src,代码行数:31,代码来源:ImageFlinger.cpp


示例6: SetupImage

bool SetupImage(xn::Context& g_context)
{
	XnStatus nRetVal = XN_STATUS_OK;
	fprintf(stderr,"Setting up the image generator\n");

	if ((nRetVal = g_image.Create(g_context))!= XN_STATUS_OK)
	{
		printf("Could not create depth generator: %s\n", xnGetStatusString(nRetVal));
		return FALSE;
	}


	if ((nRetVal = g_context.FindExistingNode(XN_NODE_TYPE_IMAGE, g_image)) != XN_STATUS_OK)
	{
		fprintf(stderr,"Could not find image sensor: %s\n", xnGetStatusString(nRetVal));
		return FALSE;
	}

	XnMapOutputMode mapMode;
	mapMode.nXRes = XN_VGA_X_RES;
	mapMode.nYRes = XN_VGA_Y_RES;
	mapMode.nFPS = 30;
	if ((nRetVal = g_image.SetMapOutputMode(mapMode)) != XN_STATUS_OK)
	{
		fprintf(stderr,"Could not set image mode: %s\n", xnGetStatusString(nRetVal));
		return FALSE;
	}
	return TRUE;
}
开发者ID:Topographic0cean,项目名称:src,代码行数:29,代码来源:ImageFlinger.cpp


示例7: main

int main(int argc, char **argv)
{
	XnStatus rc = XN_STATUS_OK;
	xn::EnumerationErrors errors;

	rc = g_Context.InitFromXmlFile(SAMPLE_XML_PATH);
	CHECK_ERRORS(rc, errors, "InitFromXmlFile");
	CHECK_RC(rc, "InitFromXml");

	rc = g_Context.FindExistingNode(XN_NODE_TYPE_DEPTH, g_DepthGenerator);
	CHECK_RC(rc, "Find depth generator");
	rc = g_Context.FindExistingNode(XN_NODE_TYPE_SCENE, g_SceneAnalyzer);
	CHECK_RC(rc, "Find scene analyzer");

	rc = g_Context.StartGeneratingAll();
	CHECK_RC(rc, "StartGenerating");

	#ifdef USE_GLUT

	glInit(&argc, argv);
	glutMainLoop();

	#elif defined(USE_GLES)

	if (!opengles_init(GL_WIN_SIZE_X, GL_WIN_SIZE_Y, &display, &surface, &context))
	{
		printf("Error initing opengles\n");
		CleanupExit();
	}

	glDisable(GL_DEPTH_TEST);
//	glEnable(GL_TEXTURE_2D);
	glEnableClientState(GL_VERTEX_ARRAY);
	glDisableClientState(GL_COLOR_ARRAY);

	while ((!_kbhit()) && (!g_bQuit))
	{
		glutDisplay();
		eglSwapBuffers(display, surface);
	}

	opengles_shutdown(display, surface, context);

	CleanupExit();

	#endif
}
开发者ID:Such1337Hax0r,项目名称:python_kinect_socketio,代码行数:47,代码来源:main.cpp


示例8: Context_Shutdown_wrapped

void Context_Shutdown_wrapped(xn::Context& self) {

#ifdef _DEBUG
    PyCout << "Shutting down OpenNI.." << std::endl;
#endif
    self.Shutdown();

}
开发者ID:CaoJohn,项目名称:PyOpenNI,代码行数:8,代码来源:ContextWrapper.cpp


示例9: initOpenNI

int initOpenNI(const XnChar* fname) {
	XnStatus nRetVal = XN_STATUS_OK;

	// initialize context
	nRetVal = xnContext.InitFromXmlFile(fname);
	CHECK_RC(nRetVal, "InitFromXmlFile");

	// initialize depth generator
	nRetVal = xnContext.FindExistingNode(XN_NODE_TYPE_DEPTH, xnDepthGenerator);
	CHECK_RC(nRetVal, "FindExistingNode(XN_NODE_TYPE_DEPTH)");

	// initialize image generator
	nRetVal = xnContext.FindExistingNode(XN_NODE_TYPE_IMAGE, xnImgeGenertor);
	CHECK_RC(nRetVal, "FindExistingNode(XN_NODE_TYPE_IMAGE)");

	return nRetVal;
}
开发者ID:comoc,项目名称:KinectTouch,代码行数:17,代码来源:KinectTouch.cpp


示例10: xnGetStatusString

bool kinect_reader2::init() {
	nRetVal = XN_STATUS_OK;

	nRetVal = g_Context.Init();
	if (nRetVal != XN_STATUS_OK) {
		printf("Creating context failed: %s\n", xnGetStatusString(nRetVal));
		return false;
	}

	nRetVal = g_DepthGenerator.Create(g_Context);
	if(nRetVal != XN_STATUS_OK) {
		printf("Creating depth generator failed: %s\n", xnGetStatusString(nRetVal));
		return false;
	}
	g_DepthGenerator.GetMirrorCap().SetMirror(true);

	nRetVal = g_UserGenerator.Create(g_Context);
	if(nRetVal != XN_STATUS_OK) {
		printf("Creating user generator failed: %s\n", xnGetStatusString(nRetVal));
		return false;
	}

	XnCallbackHandle hUserCallbacks, hCalibrationStart, hCalibrationComplete, hPoseDetected;
	if (!g_UserGenerator.IsCapabilitySupported(XN_CAPABILITY_SKELETON))
	{
		printf("Supplied user generator doesn't support skeleton\n");
		return false;
	}
	g_UserGenerator.RegisterUserCallbacks(User_NewUser, User_LostUser, NULL, hUserCallbacks);
	g_UserGenerator.GetSkeletonCap().RegisterToCalibrationStart(UserCalibration_CalibrationStart, NULL, hCalibrationStart);
	g_UserGenerator.GetSkeletonCap().RegisterToCalibrationComplete(UserCalibration_CalibrationComplete, NULL, hCalibrationComplete);

	if (!g_UserGenerator.IsCapabilitySupported(XN_CAPABILITY_POSE_DETECTION))
	{
		printf("Pose required, but not supported\n");
		return false;
	}
	g_UserGenerator.GetPoseDetectionCap().RegisterToPoseDetected(UserPose_PoseDetected, NULL, hPoseDetected);

	g_UserGenerator.GetSkeletonCap().SetSkeletonProfile(XN_SKEL_PROFILE_ALL);

	g_Context.StartGeneratingAll();

	return true;
}
开发者ID:CCJY,项目名称:engine-1,代码行数:45,代码来源:kinect_reader2.cpp


示例11: CleanupExit

void CleanupExit(){
  g_scriptNode.Release();
  g_DepthGenerator.Release();
  g_UserGenerator.Release();
  g_Player.Release();
  g_Context.Release();

  exit (1);
}
开发者ID:sgerin,项目名称:mocap,代码行数:9,代码来源:scene.cpp


示例12: CleanupExit

void CleanupExit()
{
	g_ScriptNode.Release();
	g_DepthGenerator.Release();
	g_GestureGenerator.Release();
	g_Context.Release();

	exit (1);
}
开发者ID:cphoward,项目名称:AquaKinect,代码行数:9,代码来源:main.cpp


示例13: throw

DeviceONI::DeviceONI(xn::Context& context, const std::string& file_name, bool repeat, bool streaming) throw (OpenNIException)
  : OpenNIDevice(context)
  , streaming_ (streaming)
  , depth_stream_running_ (false)
  , image_stream_running_ (false)
  , ir_stream_running_ (false)
{
  XnStatus status;
  status = context_.OpenFileRecording(file_name.c_str());
  if (status != XN_STATUS_OK)
    THROW_OPENNI_EXCEPTION("Could not open ONI file. Reason: %s", xnGetStatusString(status));

  status = context.FindExistingNode(XN_NODE_TYPE_DEPTH, depth_generator_);
  if (status != XN_STATUS_OK)
    THROW_OPENNI_EXCEPTION("could not find depth stream in file %s. Reason: %s", file_name.c_str(), xnGetStatusString(status));
  else
  {
    available_depth_modes_.push_back(getDepthOutputMode());
    depth_generator_.RegisterToNewDataAvailable ((xn::StateChangedHandler)NewONIDepthDataAvailable, this, depth_callback_handle_);
  }

  status = context.FindExistingNode(XN_NODE_TYPE_IMAGE, image_generator_);
  if (status == XN_STATUS_OK)
  {
    available_image_modes_.push_back(getImageOutputMode());
    image_generator_.RegisterToNewDataAvailable ((xn::StateChangedHandler)NewONIImageDataAvailable, this, image_callback_handle_);
  }
  
  status = context.FindExistingNode(XN_NODE_TYPE_IR, ir_generator_);
  if (status == XN_STATUS_OK)
    ir_generator_.RegisterToNewDataAvailable ((xn::StateChangedHandler)NewONIIRDataAvailable, this, ir_callback_handle_); 
  
  status = context.FindExistingNode(XN_NODE_TYPE_PLAYER, player_);
  if (status != XN_STATUS_OK)
    THROW_OPENNI_EXCEPTION("Failed to find player node: %s\n", xnGetStatusString(status));

  device_node_info_ = player_.GetInfo();

  Init ();

  player_.SetRepeat(repeat);
  if (streaming_)
    player_thread_ = boost::thread (&DeviceONI::PlayerThreadFunction, this);
}
开发者ID:gimlids,项目名称:BodyScanner,代码行数:44,代码来源:openni_device_oni.cpp


示例14: xn_init

void xn_init(char *argv)
{
  xn_call_and_check(gContext.InitFromXmlFile("../conf/SamplesConfig.xml"), "init from xml");
  
  xn::ImageGenerator image;
  xn_call_and_check(gContext.FindExistingNode(XN_NODE_TYPE_IMAGE, image), 
		    "find image node");
  xn_call_and_check(gContext.FindExistingNode(XN_NODE_TYPE_DEPTH, gDepthGenerator),
		    "find depth node");
  xn_call_and_check(gContext.FindExistingNode(XN_NODE_TYPE_USER, gUserGenerator),
		    "find user node");

  XnCallbackHandle userCB, poseCB, calibrationCB; 
  gUserGenerator.GetSkeletonCap().SetSkeletonProfile(XN_SKEL_PROFILE_ALL);
  gUserGenerator.RegisterUserCallbacks(xn_onFoundUser, xn_onLostUser, NULL, userCB);
  gUserGenerator.GetSkeletonCap().RegisterCalibrationCallbacks(NULL, xn_onCalibrated, NULL, calibrationCB);
  gUserGenerator.GetSkeletonCap().GetCalibrationPose(gPose);
  gUserGenerator.GetPoseDetectionCap().RegisterToPoseCallbacks(xn_onPoseDetected, NULL, NULL, poseCB);
  

  gImageDrawer = new ImageDrawer(image);  
  gImageDrawer->setDrawRegion(WIN_SIZE_X/15, WIN_SIZE_Y/15, WIN_SIZE_X/3, WIN_SIZE_Y/3);
  
  gDepthDrawer = new DepthDrawer(gDepthGenerator, gUserGenerator);
  gDepthDrawer->setDrawRegion(0, 0, WIN_SIZE_X, WIN_SIZE_Y);
  
  gSkeletonDrawer = new SkeletonDrawer(gUserGenerator, gDepthGenerator);
  gSkeletonDrawer->setDrawRegion(0, 0, WIN_SIZE_X, WIN_SIZE_Y);
    
  capture  = new Capture(&gContext);
  capture->setFileName(argv);

  XnSkeletonJoint joints[] = {
    XN_SKEL_HEAD, XN_SKEL_NECK, XN_SKEL_TORSO, 
    XN_SKEL_LEFT_SHOULDER, XN_SKEL_LEFT_ELBOW, XN_SKEL_LEFT_HAND,
    XN_SKEL_RIGHT_SHOULDER, XN_SKEL_RIGHT_ELBOW, XN_SKEL_RIGHT_HAND,
    XN_SKEL_LEFT_HIP, XN_SKEL_LEFT_KNEE, XN_SKEL_LEFT_FOOT,
    XN_SKEL_RIGHT_HIP, XN_SKEL_RIGHT_KNEE, XN_SKEL_RIGHT_FOOT,
  };

  for(int i = 0; i < sizeof(joints)/sizeof(XnSkeletonJoint); i++){
    capture->addSkeletonJoint(joints[i]);
  }
}
开发者ID:phelrine,项目名称:kica,代码行数:44,代码来源:kica.cpp


示例15: CleanupExit

void CleanupExit()
{
	if (g_pRecorder)
		g_pRecorder->RemoveNodeFromRecording(g_DepthGenerator);
	StopCapture();

	g_Context.Shutdown();

	exit (1);
}
开发者ID:sravanthib,项目名称:openni_annotator,代码行数:10,代码来源:main.cpp


示例16: xn_init

void xn_init(const char *filename)
{
  xn_call_and_check(gContext.Init(), "init context");
  xn_call_and_check(gContext.OpenFileRecording(filename), "set global mirror mode.");
  
  gContext.FindExistingNode(XN_NODE_TYPE_PLAYER, gPlayer);
  gPlayer.SetRepeat(false);
  
  XnStatus rc = XN_STATUS_OK;
  xn::ImageGenerator image;
  rc = gContext.FindExistingNode(XN_NODE_TYPE_IMAGE, image);
  gImageDrawer = (rc == XN_STATUS_OK)? new ImageDrawer(image) : NULL;
  
  xn::DepthGenerator depth;
  rc = gContext.FindExistingNode(XN_NODE_TYPE_DEPTH, depth);
  gDepthDrawer = (rc == XN_STATUS_OK)? new DepthDrawer(depth) : NULL;
  
  setMainWindow(IMAGE_WINDOW);
}
开发者ID:phelrine,项目名称:kica,代码行数:19,代码来源:kivi.cpp


示例17: EEThreadProc

/*
 DWORD WINAPI EEThreadProc(LPVOID lpThreadParameter)
 {
	{
		g_Context.WaitAndUpdateAll();
		if (g_bRecord)
		{
			g_pRecorder->Record();
		}
	}
	return 0;
 }
 */
int EEThreadProc(void *lpThreadParameter)
{
	{
		g_Context.WaitAndUpdateAll();
		if (g_bRecord)
		{
			g_pRecorder->Record();
		}
	}
	return 0;
}
开发者ID:imclab,项目名称:StickFigureOSC,代码行数:24,代码来源:StickFigure.cpp


示例18: mexFunction

/* The matlab mex function */
void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
    XnUInt64 *MXadress;
    if(nrhs==0)
    {
       printf("Close failed: Give Pointer to Kinect as input\n");
       mexErrMsgTxt("Kinect Error"); 
    }
    MXadress = (XnUInt64*)mxGetData(prhs[0]);
    if(MXadress[0]>0){ g_Context = ((xn::Context*) MXadress[0])[0]; }
    g_Context.Shutdown();
}
开发者ID:BIANZiyang,项目名称:RGBD_Abnormal_Detection,代码行数:12,代码来源:mxNiDeleteContext.cpp


示例19: main

/***********************************************************************************
* Main routine - additions here also. Session manager and Point control objects
will be initialized and the callbacks assigned
***********************************************************************************/
int main(int argc,char *argv[]){

	//------------------ Context initializations go in here ------------------
	
	xn::EnumerationErrors errors;								
	rc = cxt.InitFromXmlFile(SAMPLE_XML_PATH,&errors);			//initialize the context from the xml file
	
	if(rc != XN_STATUS_OK){
		printf("Failed to open:%s", xnGetStatusString(rc));		//handle error in reading from XML
		return rc;
	}
	
	rc = cxt.FindExistingNode(XN_NODE_TYPE_DEPTH,depthGen);		//try to find the depth node from the context
	if(rc != XN_STATUS_OK){										//handle error if node is not found
		printf("Failed to open Depth node!");
		return rc;
	}

	//-------------------- Init Nite objects -----------------------
	sessionMgr = new XnVSessionManager();							//session manager is created
	rc = sessionMgr->Initialize(&cxt,"Click,Wave","RaiseHand");		//session manager is initialized 
	if(rc!= XN_STATUS_OK){											//check if this init operation was good
		printf("Session manager couldn't be initialized");
		return rc;
	}

	sessionMgr->RegisterSession(&cxt,sessionStart,sessionEnd);		//register the callbacks for the session manager

	pointCtrl = new XnVPointControl("Point Tracker");				//create the point control object
	pointCtrl->RegisterPrimaryPointCreate(&cxt,pointCreate);		//register the primary point created handler
	pointCtrl->RegisterPrimaryPointUpdate(&cxt,pointUpdate);		//register the primary point updated handler
	pointCtrl->RegisterPrimaryPointDestroy(&cxt,pointDestroy);		//register the primary point destroyed handler
	
	sessionMgr->AddListener(pointCtrl);								//make the session manager listen to the point control object
	nullifyHandPoint();												//initialize the global variable to track hand points

	//----------------- GL initializations go in here --------------
	initGraphics(argc,argv);										//init GL routine
	glutMainLoop();													//start the main loop for openGL
	return 0;
}
开发者ID:robotota,项目名称:edu,代码行数:45,代码来源:Test.cpp


示例20: configKinect

int configKinect(){
		
	XnStatus rc = XN_STATUS_OK;
	xn::EnumerationErrors errors;

	// Initialize OpenNI
	rc = g_Context.InitFromXmlFile(SAMPLE_XML_PATH, g_ScriptNode, &errors);
	CHECK_ERRORS(rc, errors, "InitFromXmlFile");
	CHECK_RC(rc, "InitFromXmlFile");

	rc = g_Context.FindExistingNode(XN_NODE_TYPE_DEPTH, g_DepthGenerator);
	CHECK_RC(rc, "Find depth generator");
	rc = g_Context.FindExistingNode(XN_NODE_TYPE_GESTURE, g_GestureGenerator);
	CHECK_RC(rc, "Find gesture generator");

	XnCallbackHandle hGestureIntermediateStageCompleted, hGestureProgress, hGestureReadyForNextIntermediateStage;
	g_GestureGenerator.RegisterToGestureIntermediateStageCompleted(GestureIntermediateStageCompletedHandler, NULL, hGestureIntermediateStageCompleted);
	g_GestureGenerator.RegisterToGestureReadyForNextIntermediateStage(GestureReadyForNextIntermediateStageHandler, NULL, hGestureReadyForNextIntermediateStage);
	g_GestureGenerator.RegisterGestureCallbacks(NULL, GestureProgressHandler, NULL, hGestureProgress);

	// Create NITE objects
	g_pSessionManager = new XnVSessionManager;
	rc = g_pSessionManager->Initialize(&g_Context, "Click,Wave", "RaiseHand");
	CHECK_RC(rc, "SessionManager::Initialize");

	g_pSessionManager->RegisterSession(NULL, SessionStarting, SessionEnding, FocusProgress);

	pointHandler = new PointHandler(20, g_DepthGenerator); 
	g_pFlowRouter = new XnVFlowRouter;
	g_pFlowRouter->SetActive(pointHandler);

	g_pSessionManager->AddListener(g_pFlowRouter);

	pointHandler->RegisterNoPoints(NULL, NoHands);

	// Initialization done. Start generating
	rc = g_Context.StartGeneratingAll();
	CHECK_RC(rc, "StartGenerating");

	return rc;
}
开发者ID:cphoward,项目名称:AquaKinect,代码行数:41,代码来源:main.cpp



注:本文中的xn::Context类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ xn::DepthGenerator类代码示例发布时间:2022-05-31
下一篇:
C++ xmpp::Jid类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap