Beispiel #1
0
void XN_CALLBACK_TYPE CalibrationEnd(xn::SkeletonCapability& skeleton, XnUserID user, XnBool bSuccess, void* pCookie)
{
	printf("Calibration complete for user %d: %s\n", user, bSuccess?"Success":"Failure");
	if (bSuccess)
	{
		skeleton.StartTracking(user);
	}
	else
	{
		g_UserGenerator.GetPoseDetectionCap().StartPoseDetection("Psi", user);
	}
}
Beispiel #2
0
void XN_CALLBACK_TYPE Kinect::CalibrationEnd( xn::SkeletonCapability& skeleton,XnUserID user,
	XnCalibrationStatus eStatus,void* pCookie)
{  
	if( eStatus == XN_CALIBRATION_STATUS_OK )
	{
		skeleton.StartTracking(user);
	}
	else
	{
		skeleton.RequestCalibration( user, true );
	}
}
void XN_CALLBACK_TYPE  whu_CalibrationEnd(xn::SkeletonCapability &skeleton,XnUserID user,XnCalibrationStatus eStatus,void *pCookie)
{
	cout<<"user"<<user<<": calibrate ";
	if(eStatus == XN_CALIBRATION_STATUS_OK)
	{
		cout<<"success"<<endl;
		skeleton.StartTracking(user);
	}
	else
	{
		cout<<"failed"<<endl;
		//skeleton.RequestCalibration(user,true);//假如不需要做出投降姿势才开始的话,把此句解注释
		((xn::UserGenerator*)pCookie)->GetPoseDetectionCap().StartPoseDetection( "Psi", user );
	}	
}
Beispiel #4
0
// callback function of skeleton: calibration end   
static void XN_CALLBACK_TYPE CalibrationEnd( xn::SkeletonCapability& skeleton,XnUserID user,XnCalibrationStatus calibrationError,void* pCookie )  
{  
	std::cout << "Calibration complete for user " <<  user << ", ";  
	if( calibrationError==XN_CALIBRATION_STATUS_OK )  
	{  
		std::cout << "Success" << std::endl;  
		skeleton.StartTracking( user );  
		//userGenerator.GetSkeletonCap().SaveCalibrationDataToFile(user, "UserCalibration.txt" );  
	}  
	else  
	{  
		std::cout << "Failure" << std::endl;  
		//For the current version of OpenNI, only Psi pose is available  
		((xn::UserGenerator*)pCookie)->GetPoseDetectionCap().StartPoseDetection( "Psi", user );  
	}  
}  
Beispiel #5
0
void XN_CALLBACK_TYPE UserCalibration_CalibrationComplete(xn::SkeletonCapability& capability, XnUserID nId, XnCalibrationStatus eStatus, void* pCookie){

    XnUInt32 epochTime = 0;
    xnOSGetEpochTime(&epochTime);
    if (eStatus == XN_CALIBRATION_STATUS_OK){
        // Calibration succeeded
        LOG_D("%d Calibration complete, start tracking user %d", epochTime, nId);		
        g_SkeletonCap.StartTracking(nId);
    }
    else{
        // Calibration failed
        LOG_D("%d Calibration failed for user %d\n", epochTime, nId);
        if(eStatus==XN_CALIBRATION_STATUS_MANUAL_ABORT){
            LOG_D("%s", "Manual abort occured, stop attempting to calibrate!");
            return;
        }
        if (g_bNeedPose){
            g_UserGenerator.GetPoseDetectionCap().StartPoseDetection(g_strPose, nId);
        }
        else{
            g_SkeletonCap.RequestCalibration(nId, TRUE);
        }
    }
}