Exemplo n.º 1
0
        public static FubiUtils.RecognitionResult getCombinationRecognitionProgressOn(string recognizerName, UInt32 userID, out FubiTrackingData[] userStates, bool restart = true)
        {
            IntPtr vec     = FubiInternal.createTrackingDataVector();
            IntPtr namePtr = Marshal.StringToHGlobalAnsi(recognizerName);

            FubiUtils.RecognitionResult recognized = FubiInternal.getCombinationRecognitionProgressOn(namePtr, userID, vec, restart);
            Marshal.FreeHGlobal(namePtr);
            if (recognized == FubiUtils.RecognitionResult.RECOGNIZED)
            {
                UInt32 size = FubiInternal.getTrackingDataVectorSize(vec);
                userStates = new FubiTrackingData[size];
                for (UInt32 i = 0; i < size; i++)
                {
                    IntPtr           tInfo = FubiInternal.getTrackingData(vec, i);
                    FubiTrackingData info  = new FubiTrackingData();
                    for (UInt32 j = 0; j < (uint)FubiUtils.SkeletonJoint.NUM_JOINTS; ++j)
                    {
                        FubiInternal.getSkeletonJointPosition(tInfo, (FubiUtils.SkeletonJoint)j, out info.jointPositions[j].x, out info.jointPositions[j].y, out info.jointPositions[j].z, out info.jointPositions[j].confidence, out info.timeStamp);
                        double timeStamp = 0;
                        FubiInternal.getSkeletonJointOrientation(tInfo, (FubiUtils.SkeletonJoint)j, info.jointOrientations[j].rotMat, out info.jointPositions[j].confidence, out timeStamp);
                        info.timeStamp = Math.Max(timeStamp, info.timeStamp);
                    }
                    userStates[i] = info;
                }
            }
            else
            {
                userStates = null;
            }

            FubiInternal.releaseTrackingDataVector(vec);
            return(recognized);
        }
Exemplo n.º 2
0
        public static FubiUtils.RecognitionResult getCombinationRecognitionProgressOn(string recognizerName, UInt32 userID, bool restart = true)
        {
            IntPtr namePtr = Marshal.StringToHGlobalAnsi(recognizerName);

            FubiUtils.RecognitionResult ret = FubiInternal.getCombinationRecognitionProgressOn(namePtr, userID, new IntPtr(0), restart);
            Marshal.FreeHGlobal(namePtr);
            return(ret);
        }
Exemplo n.º 3
0
 public static FubiUtils.RecognitionResult getCombinationRecognitionProgressOn(FubiPredefinedGestures.Combinations combinationID, UInt32 userID, bool restart = true)
 {
     return(FubiInternal.getCombinationRecognitionProgressOn(combinationID, userID, new IntPtr(0), restart));
 }