当前位置: 首页>>代码示例>>C++>>正文


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

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


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

示例1: User_NewUser

// Callback: New user was detected
void XN_CALLBACK_TYPE User_NewUser(xn::UserGenerator& generator, XnUserID nId, void* pCookie)
{
	XnUInt32 epochTime = 0;
	xnOSGetEpochTime(&epochTime);
	ROS_INFO("%d New User %d\n", epochTime, nId);
	// New user found
	if (g_bNeedPose)
	{
		g_UserGenerator.GetPoseDetectionCap().StartPoseDetection(g_strPose, nId);
	}
	else
	{
		g_UserGenerator.GetSkeletonCap().RequestCalibration(nId, TRUE);
	}
  publishUserDetected(nId);
}
开发者ID:arnthorm,项目名称:Fable,代码行数:17,代码来源:main.cpp

示例2: SaveCalibration

// Save calibration to file
void SaveCalibration()
{
	XnUserID aUserIDs[20] = {0};
	XnUInt16 nUsers = 20;
	g_UserGenerator.GetUsers(aUserIDs, nUsers);
	for (int i = 0; i < nUsers; ++i)
	{
		// Find a user who is already calibrated
		if (g_UserGenerator.GetSkeletonCap().IsCalibrated(aUserIDs[i]))
		{
			// Save user's calibration to file
			g_UserGenerator.GetSkeletonCap().SaveCalibrationDataToFile(aUserIDs[i], XN_CALIBRATION_FILE_NAME);
			break;
		}
	}
}
开发者ID:arnthorm,项目名称:Fable,代码行数:17,代码来源:main.cpp

示例3: User_NewUser

void XN_CALLBACK_TYPE
User_NewUser(xn::UserGenerator& generator, XnUserID nId, void* pCookie)
{
	printf("New User: %d\n", nId);
	g_UserGenerator.GetPoseDetectionCap().StartPoseDetection(POSE_TO_USE,
	nId);
}
开发者ID:techmc,项目名称:MoPred,代码行数:7,代码来源:MetricDisplay.cpp

示例4: getAnklePitch

float RLeg::getAnklePitch(XnUserID user, xn::UserGenerator guser)
{
	
	XnSkeletonJointTransformation knee, ankle, foot;
	
	RLeg finalAngle;

	guser.GetSkeletonCap().GetSkeletonJoint(user,XN_SKEL_RIGHT_KNEE,knee);
         
	guser.GetSkeletonCap().GetSkeletonJoint(user,XN_SKEL_RIGHT_ANKLE,ankle);
			
	guser.GetSkeletonCap().GetSkeletonJoint(user,XN_SKEL_RIGHT_FOOT,foot);
			
	return (finalAngle.getAngle(knee.position.position, ankle.position.position, foot.position.position));

}
开发者ID:mastercheefryu,项目名称:ProyectosEstructurasyAlgoritmos,代码行数:16,代码来源:rleg.cpp

示例5: UserCalibration_CalibrationEnd

void XN_CALLBACK_TYPE UserCalibration_CalibrationEnd(xn::SkeletonCapability& capability, XnUserID nId, XnBool bSuccess, void* pCookie)
{
	if (bSuccess)
	{
		ROS_INFO("Calibration complete, start tracking user %d", nId);
		g_UserGenerator.GetSkeletonCap().StartTracking(nId);
	}
	else
	{
		ROS_INFO("Calibration failed for user %d", nId);
		if (g_bNeedPose)
			g_UserGenerator.GetPoseDetectionCap().StartPoseDetection(g_strPose, nId);
		else
			g_UserGenerator.GetSkeletonCap().RequestCalibration(nId, TRUE);
	}
}
开发者ID:TjlHope,项目名称:Rutler,代码行数:16,代码来源:user_tracker.cpp

示例6: getKneePitch

float RLeg::getKneePitch(XnUserID user, xn::UserGenerator guser)
{
	
	XnSkeletonJointTransformation hip, knee, ankle;
	
	RLeg finalAngle;

	guser.GetSkeletonCap().GetSkeletonJoint(user,XN_SKEL_RIGHT_HIP,hip);
         
	guser.GetSkeletonCap().GetSkeletonJoint(user,XN_SKEL_RIGHT_KNEE,knee);
			
	guser.GetSkeletonCap().GetSkeletonJoint(user,XN_SKEL_RIGHT_FOOT,ankle);
			
	return (finalAngle.getAngle(knee.position.position, hip.position.position, ankle.position.position));

}
开发者ID:mastercheefryu,项目名称:ProyectosEstructurasyAlgoritmos,代码行数:16,代码来源:rleg.cpp

示例7: getHipRoll

///Obtiene el angulo real dado por el kinect del movimiento de la cadera
float RLeg::getHipRoll(XnUserID user, xn::UserGenerator guser)
{
	
	XnSkeletonJointTransformation lhip, rhip, knee;
	
	RLeg finalAngle;

	guser.GetSkeletonCap().GetSkeletonJoint(user,XN_SKEL_LEFT_HIP,lhip);
         
	guser.GetSkeletonCap().GetSkeletonJoint(user,XN_SKEL_RIGHT_HIP,rhip);
			
	guser.GetSkeletonCap().GetSkeletonJoint(user,XN_SKEL_RIGHT_KNEE,knee);
			
	return (finalAngle.getAngle(lhip.position.position, rhip.position.position, knee.position.position));

}
开发者ID:mastercheefryu,项目名称:ProyectosEstructurasyAlgoritmos,代码行数:17,代码来源:rleg.cpp

示例8: processUsers

void processUsers(uint32_t frameId)
{
  // Process users
  XnUserID aUsers[20];
  XnUInt16 nUsers = 20;
  g_UserGenerator.GetUsers(aUsers, nUsers);
  std::vector<XnUserID> users;
  for (int i = 0; i < nUsers; ++i)
  {
    if (g_bDrawSkeleton && g_UserGenerator.GetSkeletonCap().IsTracking(aUsers[i]))
    {
      users.push_back(aUsers[i]);
    }
  }
  processAndPublish(users, frameId);
}
开发者ID:arnthorm,项目名称:Fable,代码行数:16,代码来源:main.cpp

示例9: 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

示例10: publishTransforms

void publishTransforms(const std::string& frame_id)
{
  XnUserID users[15];
  XnUInt16 users_count = 15;
  XnUserID user = 0;
  g_UserGenerator.GetUsers(users, users_count);

  for (int i = 0; i <= users_count; ++i)
  {
    user = users[i];
    if (!g_UserGenerator.GetSkeletonCap().IsTracking(user))
    {
      continue;
    }
    publishTransform(user, XN_SKEL_HEAD, frame_id, "head");
    publishTransform(user, XN_SKEL_NECK, frame_id, "neck");
    publishTransform(user, XN_SKEL_TORSO, frame_id, "torso");

//    publishTransform(user, XN_SKEL_LEFT_SHOULDER, frame_id, "left_shoulder");
//    publishTransform(user, XN_SKEL_LEFT_ELBOW, frame_id, "left_elbow");
//    publishTransform(user, XN_SKEL_LEFT_HAND, frame_id, "left_hand");
    publishTransform(user, XN_SKEL_LEFT_SHOULDER, frame_id, "right_shoulder");
    publishTransform(user, XN_SKEL_LEFT_ELBOW, frame_id, "right_elbow");
    publishTransform(user, XN_SKEL_LEFT_HAND, frame_id, "right_hand");

//    publishTransform(user, XN_SKEL_RIGHT_SHOULDER, frame_id, "right_shoulder");
//    publishTransform(user, XN_SKEL_RIGHT_ELBOW, frame_id, "right_elbow");
//    publishTransform(user, XN_SKEL_RIGHT_HAND, frame_id, "right_hand");
    publishTransform(user, XN_SKEL_RIGHT_SHOULDER, frame_id, "left_shoulder");
    publishTransform(user, XN_SKEL_RIGHT_ELBOW, frame_id, "left_elbow");
    publishTransform(user, XN_SKEL_RIGHT_HAND, frame_id, "left_hand");

//    publishTransform(user, XN_SKEL_LEFT_HIP, frame_id, "left_hip");
//    publishTransform(user, XN_SKEL_LEFT_KNEE, frame_id, "left_knee");
//    publishTransform(user, XN_SKEL_LEFT_FOOT, frame_id, "left_foot");
    publishTransform(user, XN_SKEL_LEFT_HIP, frame_id, "right_hip");
    publishTransform(user, XN_SKEL_LEFT_KNEE, frame_id, "right_knee");
    publishTransform(user, XN_SKEL_LEFT_FOOT, frame_id, "right_foot");

//    publishTransform(user, XN_SKEL_RIGHT_HIP, frame_id, "right_hip");
//    publishTransform(user, XN_SKEL_RIGHT_KNEE, frame_id, "right_knee");
//    publishTransform(user, XN_SKEL_RIGHT_FOOT, frame_id, "right_foot");
    publishTransform(user, XN_SKEL_RIGHT_HIP, frame_id, "left_hip");
    publishTransform(user, XN_SKEL_RIGHT_KNEE, frame_id, "left_knee");
    publishTransform(user, XN_SKEL_RIGHT_FOOT, frame_id, "left_foot");
  }
}
开发者ID:bit-pirate,项目名称:openni_tracker_rosmake,代码行数:47,代码来源:openni_tracker.cpp

示例11: getHeadPitch

///Obtiene el angulo real dado por el kinect del movimiento frontal de la cabeza
float Head::getHeadPitch(XnUserID user, xn::UserGenerator guser)
{
	
	XnSkeletonJointTransformation head, neck, torso;
	
	Head finalAngle;

	guser.GetSkeletonCap().GetSkeletonJoint(user,XN_SKEL_HEAD,head);
            
   	guser.GetSkeletonCap().GetSkeletonJoint(user,XN_SKEL_NECK,neck);
	           
	guser.GetSkeletonCap().GetSkeletonJoint(user,XN_SKEL_TORSO,torso);
			
	
	return (finalAngle.getAngle(head.position.position, neck.position.position, torso.position.position));

}
开发者ID:mastercheefryu,项目名称:ProyectosEstructurasyAlgoritmos,代码行数:18,代码来源:head.cpp

示例12: User_LostUser

//----------------------------------------
void XN_CALLBACK_TYPE ofxOpenNITracker::User_LostUser(xn::UserGenerator& userGenerator, XnUserID nID, void* pCookie){
	ofLogVerbose(LOG_NAME) << "Lost user" << nID;

	ofxOpenNITracker* tracker = static_cast<ofxOpenNITracker*>(pCookie);
	userGenerator.GetSkeletonCap().Reset(nID);
  tracker->users[nID];
  tracker->setUserState(nID, ofxOpenNIUser::Lost);
}
开发者ID:paulreimer,项目名称:ofxOpenNI2,代码行数:9,代码来源:ofxOpenNITracker.cpp

示例13: CheckPosture

// track two users 
// take down users' joint positions
// calculate joint angles and etc.
void CheckPosture(const xn::DepthMetaData& dmd, const xn::SceneMetaData& smd, FILE *fp)
{
	XnUserID aUsers[2];
	XnUInt16 nUsers = 2;
	g_UserGenerator.GetUsers(aUsers, nUsers);

	for(int i = 0; i < nUsers; ++i)
	{
		// if the user is being tracked
		// take down his/her joint positions
		if (g_UserGenerator.GetSkeletonCap().IsTracking(aUsers[i]))
		{
			// check user posture
			RecordAngle(aUsers[i], fp);
		}
	}
}
开发者ID:scottmeng,项目名称:VOBE_user_state_detection,代码行数:20,代码来源:PostureChecker.cpp

示例14: new_user

// Callback: New user was detected
void XN_CALLBACK_TYPE new_user(xn::UserGenerator& generator, XnUserID nId, void* pCookie) {
	printf("New User %d\n", nId);
	userGenerator.GetSkeletonCap().RequestCalibration(nId, TRUE);

	if (kitchenMode) return;

	lo_send(addr, "/new_user","i",(int)nId);
}
开发者ID:YggdrasiI,项目名称:OSCeleton,代码行数:9,代码来源:OSCeleton.cpp

示例15: whu_NewUser

void XN_CALLBACK_TYPE whu_NewUser(xn::UserGenerator &generator,
	XnUserID user,
	void* pCookie)
{
	cout<<"New User Identified:"<<user<<endl;
	//generator.GetSkeletonCap().RequestCalibration(user,true);//假如不需要做出投降姿势才开始的话,把此句解注释
	generator.GetPoseDetectionCap().StartPoseDetection("Psi", user);//做出[ 。]姿势以开始用户认证//
}
开发者ID:ShelmyLin,项目名称:Powerful_Atom_Hand,代码行数:8,代码来源:whu_MyHand.cpp


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