Explorar el Código

bug fix + handmask dilation

Alexander Hendrich hace 11 años
padre
commit
e58d4c82bc

+ 1 - 1
bbiwarg/Detectors/FingerDetection/FingerSliceTrail.cs

@@ -41,7 +41,7 @@ namespace bbiwarg.Detectors.FingerDetection
         public Vector2D getStartDirection()
         {
             int innerStartIndex = Math.Min(NumSlices, Constants.FingerNumSlicesForRelativeDirection);
-            return (EndSlice.Mid - slices[innerStartIndex].Mid).normalize();
+            return (StartSlice.Mid - slices[innerStartIndex].Mid).normalize();
         }
 
         public Vector2D getEndDirection()

+ 1 - 1
bbiwarg/Detectors/HandDetection/HandDetector.cs

@@ -81,7 +81,7 @@ namespace bbiwarg.Detectors.HandDetection
                     CvInvoke.cvFloodFill(image, finger.HandPoint, new MCvScalar(255), new MCvScalar(1), new MCvScalar(1), out comp, Emgu.CV.CvEnum.CONNECTIVITY.FOUR_CONNECTED, Emgu.CV.CvEnum.FLOODFILL_FLAG.DEFAULT, mask);
                     if (comp.area < maxArea * Constants.HandMaxSize)
                     {
-                        Image<Gray, byte> cropedMask = mask.Copy(new Rectangle(1, 1, width, height)).Mul(255);
+                        Image<Gray, byte> cropedMask = mask.Copy(new Rectangle(1, 1, width, height)).Mul(255).Dilate(1);
                         Hand hand = new Hand(cropedMask, finger);
                         Hands.Add(hand);
                         HandMask = HandMask.Or(cropedMask);