Beispiel #1
0
 public static FubiUtils.RecognitionResult recognizeGestureOn(string recognizerName, UInt32 userID, out FubiUtils.RecognitionCorrectionHint correctionHint)
 {
     IntPtr namePtr = Marshal.StringToHGlobalAnsi(recognizerName);
     FubiUtils.RecognitionCorrectionHint hint = new FubiUtils.RecognitionCorrectionHint();
     FubiUtils.RecognitionResult ret = FubiInternal.recognizeGestureOn(namePtr, userID, hint);
     correctionHint = hint;
     Marshal.FreeHGlobal(namePtr);
     return ret;
 }
Beispiel #2
0
 public static FubiUtils.RecognitionResult getCombinationRecognitionProgressOnHand(string recognizerName, uint handID, out FubiUtils.RecognitionCorrectionHint correctionHint, bool restart = true)
 {
     IntPtr namePtr = Marshal.StringToHGlobalAnsi(recognizerName);
     FubiUtils.RecognitionCorrectionHint hint = new FubiUtils.RecognitionCorrectionHint();
     FubiUtils.RecognitionResult ret = FubiInternal.getCombinationRecognitionProgressOnHand(namePtr, handID, new IntPtr(0), restart, false, hint);
     correctionHint = hint;
     Marshal.FreeHGlobal(namePtr);
     return ret;
 }
Beispiel #3
0
 public static FubiUtils.RecognitionResult recognizeGestureOn(UInt32 recognizerIndex, UInt32 userID, out FubiUtils.RecognitionCorrectionHint correctionHint)
 {
     FubiUtils.RecognitionCorrectionHint hint = new FubiUtils.RecognitionCorrectionHint();
     FubiUtils.RecognitionResult res = FubiInternal.recognizeGestureOn(recognizerIndex, userID, hint);
     correctionHint = hint;
     return res;
 }
Beispiel #4
0
 public static FubiUtils.RecognitionResult getCombinationRecognitionProgressOnHand(string recognizerName, uint handID, bool restart = true)
 {
     FubiUtils.RecognitionCorrectionHint hint = new FubiUtils.RecognitionCorrectionHint();
     return getCombinationRecognitionProgressOnHand(recognizerName, handID, out hint, restart);
 }
Beispiel #5
0
        public static FubiUtils.RecognitionResult getCombinationRecognitionProgressOn(string recognizerName, UInt32 userID, out FubiTrackingData[] userStates,
            out FubiUtils.RecognitionCorrectionHint correctionHint, bool restart = true, bool returnFilteredData = false)
        {
            IntPtr vec = FubiInternal.createTrackingDataVector();
            IntPtr namePtr = Marshal.StringToHGlobalAnsi(recognizerName);
            FubiUtils.RecognitionCorrectionHint hint = new FubiUtils.RecognitionCorrectionHint();
            FubiUtils.RecognitionResult recognized = FubiInternal.getCombinationRecognitionProgressOn(namePtr, userID, vec, restart, returnFilteredData, hint);
            correctionHint = hint;
            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;
                        float[] rotMat = new float[9];
                        FubiInternal.getSkeletonJointOrientation(tInfo, (FubiUtils.SkeletonJoint)j, rotMat, out info.jointPositions[j].confidence, out timeStamp);
                        FubiUtils.Math.rotMatToRotation(rotMat, out info.jointOrientations[j].rx, out info.jointOrientations[j].ry, out info.jointOrientations[j].rz);
                        info.timeStamp = Math.Max(timeStamp, info.timeStamp);
                    }
                    userStates[i] = info;
                }
            }
            else
                userStates = null;

            FubiInternal.releaseTrackingDataVector(vec);
            return recognized;
        }
Beispiel #6
0
 public static FubiUtils.RecognitionResult getCombinationRecognitionProgressOn(string recognizerName, UInt32 userID, out FubiTrackingData[] userStates,
    bool restart = true, bool returnFilteredData = false)
 {
     FubiUtils.RecognitionCorrectionHint hint = new FubiUtils.RecognitionCorrectionHint();
     return getCombinationRecognitionProgressOn(recognizerName, userID, out userStates, out hint, restart, returnFilteredData);
 }
Beispiel #7
0
 public static FubiUtils.RecognitionResult getCombinationRecognitionProgressOn(FubiPredefinedGestures.Combinations combinationID, UInt32 userID, out FubiTrackingData[] userStates,
     bool restart = true, bool returnFilteredData = false)
 {
     FubiUtils.RecognitionCorrectionHint dummy = new FubiUtils.RecognitionCorrectionHint();
     return getCombinationRecognitionProgressOn(combinationID, userID, out userStates, out dummy, restart, returnFilteredData);
 }
Beispiel #8
0
 public static FubiUtils.RecognitionResult getCombinationRecognitionProgressOn(FubiPredefinedGestures.Combinations combinationID, UInt32 userID, out FubiUtils.RecognitionCorrectionHint correctionHint, bool restart = true)
 {
     FubiUtils.RecognitionCorrectionHint hint = new FubiUtils.RecognitionCorrectionHint();
     FubiUtils.RecognitionResult res = FubiInternal.getCombinationRecognitionProgressOn(combinationID, userID, new IntPtr(0), restart, false, hint);
     correctionHint = hint;
     return res;
 }