|
@@ -32,7 +32,7 @@ namespace bbiwarg.Detectors.Palm
|
|
private List<MCvConvexityDefect> convexityDefects;
|
|
private List<MCvConvexityDefect> convexityDefects;
|
|
private Vector2D wristPoint, wristDirection;
|
|
private Vector2D wristPoint, wristDirection;
|
|
private LineSegment2DF wristLine, thumbLine;
|
|
private LineSegment2DF wristLine, thumbLine;
|
|
- private Quad2D palmRect;
|
|
+ private Quadrangle palmQuad;
|
|
|
|
|
|
private bool valid = false;
|
|
private bool valid = false;
|
|
private Vector2D topLeft;
|
|
private Vector2D topLeft;
|
|
@@ -72,9 +72,9 @@ namespace bbiwarg.Detectors.Palm
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public PalmRect getPalm()
|
|
+ public Quadrangle getPalmQuad()
|
|
{
|
|
{
|
|
- return new PalmRect(palmRect);
|
|
+ return palmQuad;
|
|
}
|
|
}
|
|
|
|
|
|
private List<Finger> getFingersWithoutThumb(FingerDetector fingerDetector)
|
|
private List<Finger> getFingersWithoutThumb(FingerDetector fingerDetector)
|
|
@@ -220,12 +220,12 @@ namespace bbiwarg.Detectors.Palm
|
|
wristLine = new LineSegment2DF(bottomLeft - 1000 * handWidth, bottomRight + 1000 * handWidth);
|
|
wristLine = new LineSegment2DF(bottomLeft - 1000 * handWidth, bottomRight + 1000 * handWidth);
|
|
thumbLine = new LineSegment2DF(topLeft + 1000 * handLength, bottomLeft - 1000 * handLength);
|
|
thumbLine = new LineSegment2DF(topLeft + 1000 * handLength, bottomLeft - 1000 * handLength);
|
|
|
|
|
|
- palmRect = new Quad2D(bottomLeft, topLeft, topRight, bottomRight);
|
|
+ palmQuad = new Quadrangle(new Vector2D[] {bottomLeft, topLeft, topRight, bottomRight});
|
|
|
|
|
|
valid = true;
|
|
valid = true;
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- palmRect = null;
|
|
+ palmQuad = null;
|
|
valid = false;
|
|
valid = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -252,9 +252,9 @@ namespace bbiwarg.Detectors.Palm
|
|
palmImage.drawLine(wristLine, PalmImageState.wristLine);
|
|
palmImage.drawLine(wristLine, PalmImageState.wristLine);
|
|
palmImage.drawLine(thumbLine, PalmImageState.thumbLine);
|
|
palmImage.drawLine(thumbLine, PalmImageState.thumbLine);
|
|
|
|
|
|
- if (palmRect != null)
|
|
+ if (palmQuad != null)
|
|
{
|
|
{
|
|
- PointF[] vertices = palmRect.getVertices();
|
|
+ Vector2D[] vertices = palmQuad.Vertices;
|
|
for (int i = 0; i < 4; ++i)
|
|
for (int i = 0; i < 4; ++i)
|
|
palmImage.drawLine(new LineSegment2DF(vertices[i], vertices[(i + 1) % 4]), PalmImageState.palmRect);
|
|
palmImage.drawLine(new LineSegment2DF(vertices[i], vertices[(i + 1) % 4]), PalmImageState.palmRect);
|
|
|
|
|