|
@@ -25,11 +25,10 @@ namespace bbiwarg.Recognition.PalmRecognition
|
|
private List<MCvConvexityDefect> convexityDefects;
|
|
private List<MCvConvexityDefect> convexityDefects;
|
|
private Vector2D thumbDefectStart;
|
|
private Vector2D thumbDefectStart;
|
|
private Vector2D thumbDefectEnd;
|
|
private Vector2D thumbDefectEnd;
|
|
- public Vector2D thumbDefectDepth;
|
|
|
|
-
|
|
|
|
|
|
+ private Vector2D thumbDefectDepth;
|
|
private Kalman2DPositionFilter thumbDefectDepthFilter, thumbDefectStartFilter, thumbDefectEndFilter;
|
|
private Kalman2DPositionFilter thumbDefectDepthFilter, thumbDefectStartFilter, thumbDefectEndFilter;
|
|
-
|
|
|
|
private int numFramesNoHandFound;
|
|
private int numFramesNoHandFound;
|
|
|
|
+ private float lastPalmQuadArea;
|
|
|
|
|
|
public Quadrangle PalmQuad { get; private set; }
|
|
public Quadrangle PalmQuad { get; private set; }
|
|
|
|
|
|
@@ -103,6 +102,7 @@ namespace bbiwarg.Recognition.PalmRecognition
|
|
palmContour = null;
|
|
palmContour = null;
|
|
PalmQuad = null;
|
|
PalmQuad = null;
|
|
numFramesNoHandFound = 0;
|
|
numFramesNoHandFound = 0;
|
|
|
|
+ lastPalmQuadArea = 0.0f;
|
|
}
|
|
}
|
|
|
|
|
|
private void findLongestPalmContour()
|
|
private void findLongestPalmContour()
|
|
@@ -244,7 +244,13 @@ namespace bbiwarg.Recognition.PalmRecognition
|
|
bottomRight = bottomLeft + handWidth;
|
|
bottomRight = bottomLeft + handWidth;
|
|
topRight = bottomRight + 1.2f * handLength - 0.3f * handWidth;
|
|
topRight = bottomRight + 1.2f * handLength - 0.3f * handWidth;
|
|
|
|
|
|
- PalmQuad = new Quadrangle(bottomLeft, topLeft, topRight, bottomRight);
|
|
|
|
|
|
+ Quadrangle quad = new Quadrangle(bottomLeft, topLeft, topRight, bottomRight);
|
|
|
|
+ if (lastPalmQuadArea == 0.0f ||
|
|
|
|
+ (quad.Area / lastPalmQuadArea >= Constants.PalmMinAreaQuotient && quad.Area / lastPalmQuadArea <= Constants.PalmMaxAreaQuotient))
|
|
|
|
+ {
|
|
|
|
+ PalmQuad = quad;
|
|
|
|
+ lastPalmQuadArea = PalmQuad.Area;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|