소스 검색

Added minimum thumb defect depth.

Daniel Kauth 11 년 전
부모
커밋
2b211f2499
2개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 0
      bbiwarg/Constants.cs
  2. 2 2
      bbiwarg/Detectors/PalmDetection/PalmDetector.cs

+ 1 - 0
bbiwarg/Constants.cs

@@ -45,6 +45,7 @@ namespace bbiwarg
         public static readonly float PalmMaxThumbDefectAngle = 110; // degree
         public static readonly float PalmMaxThumbDefectLengthQuotient = 2.2f;
         public static readonly float PalmMinThumbDefectLengthQuotient = 1.2f;
+        public static readonly float PalmMinTumbDefectDepth = 30.0f;
         
         //palm Grid
         public static readonly int PalmGridRows = 4;

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

@@ -160,9 +160,9 @@ namespace bbiwarg.Detectors.PalmDetection
                 float angle = (float) ((depth - start).getAngleBetween(depth - end) * 180 / Math.PI);
 
                 if (angle <= Constants.PalmMaxThumbDefectAngle && 
-                    lengthQuotient >= Constants.PalmMinThumbDefectLengthQuotient && lengthQuotient <= Constants.PalmMaxThumbDefectLengthQuotient)
+                    lengthQuotient >= Constants.PalmMinThumbDefectLengthQuotient && lengthQuotient <= Constants.PalmMaxThumbDefectLengthQuotient &&
+                    d.Depth >= Constants.PalmMinTumbDefectDepth)
                 {
-                    Console.WriteLine(d.Depth);
                     return d;
                 }
             }