Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VC++ Kinect SDK
Hi,
I m trying to lock a single skeleton using Microsoft Kinect SDK v 1.7 . My requirements are
• First lock a single skeleton.
• Check the tracking state of the of the locked skeleton.
• If the tracking state of the locked skeleton is NOT Tracked,then
• ----->check for the next closest skeleton
• ----->lock this skeleton.
How do I do this using vc++2010. The code which i tried is given below.
 

<pre lang="c++">
 
TrackSingleSkeleton(NUI_SKELETON_FRAME* pSkeletonFrame)
{
	DWORD dwTrackingIDs[NUI_SKELETON_MAX_TRACKED_COUNT]={0, 0};
	m_pNuiSensor->NuiSkeletonTrackingEnable(m_hNextSkeletonEvent,NUI_SKELETON_TRACKING_FLAG_TITLE_SETS_TRACKED_SKELETONS);
	 for (int i = 0; i < NUI_SKELETON_COUNT; i++)
	 {
		const NUI_SKELETON_DATA & skeleton = pSkeletonFrame->SkeletonData[i];
		if (skeleton.eTrackingState == NUI_SKELETON_TRACKED)
	      {	
			dwTrackingIDs[0] = skeleton.dwTrackingID;
			dwTrackingIDs[1] = 0; // or 0, if you want to track only one
			
		 }
 
		 else if(skeleton.eTrackingState == NUI_SKELETON_POSITION_ONLY)
		 {			 
			dwTrackingIDs[0] = skeleton.dwTrackingID;
			dwTrackingIDs[1] = 0;
		 }
		 if (dwTrackingIDs[0] > 0)
		 {
			m_pNuiSensor->NuiSkeletonSetTrackedSkeletons(dwTrackingIDs); // Track this skeleton
		 }
	 }
	//m_pNuiSensor->NuiSkeletonSetTrackedSkeletons(dwTrackingIDs);
 
	 
}
 

 

 

But here i m not able to lock the skeleton.Help pls...
 
Regards,
Sandhya.
Posted 24-Mar-13 21:06pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 325
1 DamithSL 300
2 Sergey Alexandrovich Kryukov 289
3 CPallini 235
4 Maciej Los 215
0 OriginalGriff 5,455
1 DamithSL 4,422
2 Maciej Los 3,860
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,010


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 25 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100