Software Archive
Read-only legacy content
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
17065 Discussions

finger detection

leonid_b_1
Beginner
83 Views

hello,

I am running my f200 camera in hand detection mode, I get crash while i am trying to get AcquireFrame.

I would like that my camera detect my hand(one of my fingers) and will write to output the coordinate of it.

This is my code:

            // Create a PXCMSenseManager instance
            PXCMSenseManager sm = PXCMSenseManager.CreateInstance();

            // Select the depth stream
            sm.EnableHand();

            // Get an instance of PXCMHandModule 
            PXCMHandModule handModule = sm.QueryHand();

            // Create the hand data instance
            PXCMHandData handData = handModule.CreateOutput();

            PXCMHandData.IHand hand;

            // Get an instance of PXCMHandConfiguration
            PXCMHandConfiguration handConfig = handModule.CreateActiveConfiguration();

            // Make configuration changes and apply them
            handConfig.EnableJointSpeed(PXCMHandData.JointType.JOINT_INDEX_BASE,PXCMHandData.JointSpeedType.JOINT_SPEED_ABSOLUTE, 3);
            handConfig.EnableAllAlerts(); ;

            // set other configuration options
            handConfig.ApplyChanges(); // Changes only take effect when you call ApplyChanges

            sm.Init();

            PXCMHandData.FingerData fingerData;
            PXCMHandData.ExtremityData extremitydata;

            // Main processing loop
            while (sm.AcquireFrame(true).IsSuccessful())
            {
                // Retrieve current hand tracking results
                handData.Update();

                handData.QueryHandData(PXCMHandData.AccessOrderType.ACCESS_ORDER_BY_ID, 1, out hand);

                hand.QueryFingerData(PXCMHandData.FingerType.FINGER_INDEX, out fingerData);

                hand.QueryExtremityPoint(PXCMHandData.ExtremityType.EXTREMITY_CLOSEST, out extremitydata);

                Console.Clear();
                Console.WriteLine("X = " + extremitydata.pointWorld.x);
                Console.WriteLine("Y = " + extremitydata.pointWorld.y);
                Console.WriteLine("Z = " + extremitydata.pointWorld.z);

                // Resume next frame processing
                sm.ReleaseFrame();
            }
            handData.Dispose();
            sm.Dispose();

thanks,Leonid

0 Kudos
1 Reply
Xusheng_L_Intel
Employee
83 Views

Have you tried our sample app(C:\Program Files (x86)\Intel\RSSDK\framework\CSharp\FF_HandsViewer.cs) in the RealSense SDK? What kind system are you using? Thanks!

Reply