|
@@ -52,7 +52,7 @@ namespace bbiwarg.Graphics
|
|
|
currentFilter = new Kalman2DPositionFilter(e.RelativePalmPosition);
|
|
|
pos = e.RelativePalmPosition;
|
|
|
}
|
|
|
- else
|
|
|
+ else
|
|
|
{
|
|
|
pos = currentFilter.getCorrectedPosition(e.RelativePalmPosition);
|
|
|
}
|
|
@@ -70,11 +70,26 @@ namespace bbiwarg.Graphics
|
|
|
|
|
|
public void updateImage()
|
|
|
{
|
|
|
- OutputImage = new OutputImage(width, height);
|
|
|
-
|
|
|
+ OutputImage = new OutputImage(width, height);
|
|
|
+
|
|
|
int size = Math.Min(width, height);
|
|
|
OutputImage.drawRectangle(0, 0, size - 1, size - 1, Color.White);
|
|
|
|
|
|
+ int numRows = Constants.PalmGridRows;
|
|
|
+ int numColumns = Constants.PalmGridColumns;
|
|
|
+
|
|
|
+ for (int i = 1; i < numRows; i++)
|
|
|
+ {
|
|
|
+ int tmp = size / numRows * i;
|
|
|
+ OutputImage.drawLineSegment(new LineSegment2D(new Vector2D(0, tmp), new Vector2D(size - 2, tmp)), Constants.PalmGridColor);
|
|
|
+ }
|
|
|
+ for (int i = 1; i < numColumns; i++)
|
|
|
+ {
|
|
|
+ int tmp = size / numColumns * i;
|
|
|
+ OutputImage.drawLineSegment(new LineSegment2D(new Vector2D(tmp, 0), new Vector2D(tmp, size-2)), Constants.PalmGridColor);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
foreach (List<Vector2D> positions in touchPositions)
|
|
|
{
|
|
|
for (int i = 1; i < positions.Count; ++i)
|