Browse Source

Fixed hand side for only one hand.

Daniel Kauth 10 years ago
parent
commit
bb54a8344d
1 changed files with 8 additions and 0 deletions
  1. 8 0
      bbiwarg/Recognition/HandRecognition/HandDetector.cs

+ 8 - 0
bbiwarg/Recognition/HandRecognition/HandDetector.cs

@@ -103,6 +103,14 @@ namespace bbiwarg.Recognition.HandRecognition
                 else
                     hand.Side = Hand.HandSide.Right;
             }
+
+            if (Hands.Count == 1 && Hands[0].Fingers.Count == 1)
+            {
+                if (Hands[0].Centroid.X < Hands[0].Fingers[0].HandPoint.X)
+                    Hands[0].Side = Hand.HandSide.Right;
+                else
+                    Hands[0].Side = Hand.HandSide.Left;
+            }
         }
 
         private void drawHands() {