|
@@ -223,7 +223,8 @@ namespace bbiwarg.Detectors.PalmDetection
|
|
|
{
|
|
|
Utility.LineSegment2D defectLine = new Utility.LineSegment2D(new Vector2D(d.StartPoint), new Vector2D(d.EndPoint));
|
|
|
Vector2D intersection = defectLine.Line.getIntersection(f.LineSegment.Line);
|
|
|
- if (intersection.isInBox(defectLine.P1, defectLine.P2) && intersection.isInBox(f.LineSegment.P1, f.LineSegment.P2))
|
|
|
+ if (intersection != null &&
|
|
|
+ intersection.isInBox(defectLine.P1, defectLine.P2) && intersection.isInBox(f.LineSegment.P1, f.LineSegment.P2))
|
|
|
{
|
|
|
fingerIntersectsStartEnd = true;
|
|
|
break;
|
|
@@ -264,7 +265,7 @@ namespace bbiwarg.Detectors.PalmDetection
|
|
|
}
|
|
|
|
|
|
|
|
|
- /*Console.WriteLine("no palm defect found (" + i + ")");
|
|
|
+ Console.WriteLine("no palm defect found (" + i + ")");
|
|
|
foreach (MCvConvexityDefect d in convexityDefects)
|
|
|
{
|
|
|
Vector2D depth = new Vector2D(d.DepthPoint);
|
|
@@ -278,7 +279,7 @@ namespace bbiwarg.Detectors.PalmDetection
|
|
|
float angle = (float)((depth - start).getAngleBetween(depth - end) * 180 / Math.PI);
|
|
|
|
|
|
Console.WriteLine("angle: " + angle + " quotient: " + lengthQuotient);
|
|
|
- }*/
|
|
|
+ }
|
|
|
|
|
|
++i;
|
|
|
return null;
|