Bladeren bron

detect figner direction

Alexander Hendrich 11 jaren geleden
bovenliggende
commit
ebf5e6d0d6
2 gewijzigde bestanden met toevoegingen van 8 en 1 verwijderingen
  1. 4 1
      bbiwarg/Detectors/Fingers/FingerDetector.cs
  2. 4 0
      bbiwarg/Detectors/Fingers/FingerSliceTrail.cs

+ 4 - 1
bbiwarg/Detectors/Fingers/FingerDetector.cs

@@ -140,7 +140,10 @@ namespace bbiwarg.Detectors.Fingers
                 if (trail.NumSlices >= minNumSlices)
                 {
                     //reorder finger slice so that it goes tip->hand
-                    //TODO
+                    Int16 depthAtTip = depthImage.getDepthAt((int)trail.Start.Mid.X, (int)trail.Start.Mid.Y);
+                    Int16 depthAtHand = depthImage.getDepthAt((int)trail.End.Mid.X, (int)trail.End.Mid.Y);
+                    if (depthAtTip < depthAtHand)
+                        trail.reverse();
 
                     Finger finger = new Finger(trail);
 

+ 4 - 0
bbiwarg/Detectors/Fingers/FingerSliceTrail.cs

@@ -31,5 +31,9 @@ namespace bbiwarg.Detectors.Fingers
         {
             return slices;
         }
+
+        public void reverse() {
+            slices.Reverse();
+        }
     }
 }