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.
<code>
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);
}
</code>
But here i m not able to lock the skeleton.Help pls...
Regards,
Sandhya.
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.
<code>
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);
}
</code>
But here i m not able to lock the skeleton.Help pls...
Regards,
Sandhya.