Преглед на файлове

changed proportions of palmQuad

Alexander Hendrich преди 11 години
родител
ревизия
0c4c9f1245

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

@@ -37,7 +37,7 @@ namespace bbiwarg.Detectors.FingerDetection
                 pointsB.Add(slice.End + Constants.FingerContourMargin * direction);
             }
 
-            pointsB.Reverse();
+            pointsA.Reverse();
             pointsA.AddRange(pointsB);
 
             Contour<Point> contour = new Contour<Point>(new MemStorage());

+ 5 - 0
bbiwarg/Detectors/HandDetection/HandDetector.cs

@@ -42,6 +42,11 @@ namespace bbiwarg.Detectors.HandDetection
             //draw top finger slice
             foreach (Finger finger in fingers)
             {
+                // TODO: connect contour with other edges
+                //Contour<Point> contour = finger.getContour();
+                //image.FillConvexPoly(contour.ToArray(), new Gray(0));
+                //image.DrawPolyline(finger.getContour().ToArray(), false, new Gray(255), 1);
+
                 FingerSlice slice = finger.SliceTrail.Slices[1];
                 image.Draw(new Emgu.CV.Structure.LineSegment2D(slice.Start, slice.End), new Gray(255), 2);
             }

+ 5 - 5
bbiwarg/Detectors/PalmDetection/PalmDetector.cs

@@ -318,8 +318,8 @@ namespace bbiwarg.Detectors.PalmDetection
                 {
                     //right hand
                     handLength = thumbDefectStart - thumbDefectDepth;
-                    handWidth = 0.8f * new Vector2D(-handLength.Y, handLength.X);
-                    topLeft = thumbDefectStart;
+                    handWidth = 0.85f * new Vector2D(-handLength.Y, handLength.X);
+                    topLeft = thumbDefectStart+0.15f*handLength;
                     bottomLeft = thumbDefectDepth - 0.4f * handLength;
                     bottomRight = bottomLeft + handWidth;
                     topRight = bottomRight + 1.2f * handLength - 0.3f * handWidth;
@@ -328,11 +328,11 @@ namespace bbiwarg.Detectors.PalmDetection
                 {
                     //left hand
                     handLength = thumbDefectEnd - thumbDefectDepth;
-                    handWidth = 0.8f * new Vector2D(handLength.Y, -handLength.X);
-                    topRight = thumbDefectEnd;
+                    handWidth = 0.85f * new Vector2D(handLength.Y, -handLength.X);
+                    topRight = thumbDefectEnd+0.15f*handLength;
                     bottomRight = thumbDefectDepth - 0.4f * handLength;
                     bottomLeft = bottomRight + handWidth;
-                    topLeft = bottomLeft + 1.2f * handLength - 0.3f * handWidth;
+                    topLeft = bottomLeft + 1.15f * handLength - 0.35f * handWidth;
                 }
 
                 PalmQuad = new Quadrangle(bottomLeft, topLeft, topRight, bottomRight);