|
@@ -208,28 +208,32 @@ namespace bbiwarg.Detectors.PalmDetection
|
|
|
|
|
|
lastThumbDefectDepth = thumbDefectDepth;
|
|
|
|
|
|
- Vector2D handLength, handWidth, topLeft, bottomLeft, bottomRight, topRight;
|
|
|
- if (palmHand.Side == Hand.HandSide.Left)
|
|
|
+ Vector2D handLength, handWidth, longestLineEndpoint, topLeft, bottomLeft, bottomRight, topRight;
|
|
|
+
|
|
|
+ Vector2D startDepth = thumbDefectStart - thumbDefectDepth;
|
|
|
+ Vector2D endDepth = thumbDefectEnd - thumbDefectDepth;
|
|
|
+
|
|
|
+ if (startDepth.Length > endDepth.Length)
|
|
|
{
|
|
|
- //left hand
|
|
|
- handLength = thumbDefectStart - thumbDefectDepth;
|
|
|
- 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;
|
|
|
+ handLength = startDepth;
|
|
|
+ longestLineEndpoint = thumbDefectStart;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- //right hand
|
|
|
- handLength = thumbDefectEnd - thumbDefectDepth;
|
|
|
- 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.15f * handLength - 0.35f * handWidth;
|
|
|
+ handLength = endDepth;
|
|
|
+ longestLineEndpoint = thumbDefectEnd;
|
|
|
}
|
|
|
|
|
|
+ if (palmHand.Side == Hand.HandSide.Left)
|
|
|
+ handWidth = 0.85f * new Vector2D(-handLength.Y, handLength.X);
|
|
|
+ else
|
|
|
+ handWidth = 0.85f * new Vector2D(handLength.Y, -handLength.X);
|
|
|
+
|
|
|
+ topLeft = longestLineEndpoint + 0.15f * handLength;
|
|
|
+ bottomLeft = thumbDefectDepth - 0.4f * handLength;
|
|
|
+ bottomRight = bottomLeft + handWidth;
|
|
|
+ topRight = bottomRight + 1.15f * handLength - 0.35f * handWidth;
|
|
|
+
|
|
|
PalmQuad = new Quadrangle(bottomLeft, topLeft, topRight, bottomRight);
|
|
|
}
|
|
|
}
|