Software Archive
Read-only legacy content
17061 Discussions

Skeleton Tracking Not Working

Wik_P_
Beginner
421 Views

Hi, I would like to do skeleton tracking but the number of joints returned is always 0.

My goal is to track the body skeleton from 4 meter and I would like to track when a person raise his hand.

Below is my code, did I do anything wrong? Thanks!

//Initialization
                // Create the SenseManager instance  
                sm = PXCMSenseManager.CreateInstance();

                // Enable the color stream
                sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR, ImageWidth, ImageHeight, 30);

                // Enable person tracking
                sm.EnablePersonTracking();
                personModule = sm.QueryPersonTracking();
                PXCMPersonTrackingConfiguration personConfig = personModule.QueryConfiguration();
                personConfig.SetTrackedAngles(PXCMPersonTrackingConfiguration.TrackingAngles.TRACKING_ANGLES_FRONTAL);

                // Skeleton
                PXCMPersonTrackingConfiguration.SkeletonJointsConfiguration skeletonConfig = personConfig.QuerySkeletonJoints();
                skeletonConfig.SetMaxTrackedPersons(1);
                skeletonConfig.SetTrackingArea(PXCMPersonTrackingConfiguration.SkeletonJointsConfiguration.SkeletonMode.AREA_UPPER_BODY_ROUGH);
                skeletonConfig.Enable();


//Update
PXCMPersonTrackingData.PersonJoints personJoint = trackedPerson.QuerySkeletonJoints();
                    int njoints = personJoint.QueryNumJoints();
                    myTrackedPerson.JointsDetected = njoints;
                    PXCMPersonTrackingData.PersonJoints.SkeletonPoint[] joints = new PXCMPersonTrackingData.PersonJoints.SkeletonPoint[njoints];
                    if (njoints > 0)
                    {
                        if (personJoint.QueryJoints(joints))
                        {
                            for (int i = 0; i < njoints; i++)
                            {
                                if (joints.confidenceImage > 80)
                                {
                                    if (joints.jointType == PXCMPersonTrackingData.PersonJoints.JointType.JOINT_HEAD)
                                    {
                                        myTrackedPerson.HeadX = (int)joints.image.x;
                                        myTrackedPerson.HeadY = (int)joints.image.y;
                                    }
                                }

                            }
                        }
                    }

 

0 Kudos
3 Replies
Wik_P_
Beginner
421 Views

Hi Johannes:

I am using R200 and I am running on Windows 10.

Best Regards,

Wik

0 Kudos
Wik_P_
Beginner
421 Views

Hi, is there anyone from Intel to help to review the issue? I would like to know if this feature is not matured yet or my code has some problem. Thanks a lot!

0 Kudos
mohan_g_1
Beginner
421 Views

Hi Wik,

I also want to detect some joints of a person. But the java library libpxcclr.java they provided doesn't have any member function EnablePersonTracking()for PXCMSenseManager class. 
Can you please provide your library file to me?

Thanks,

-MohanG

0 Kudos
Reply