|
@@ -26,7 +26,8 @@ namespace bbiwarg.Output.GlassesOutput
|
|
|
private ImageSize inputSize;
|
|
|
private ImageSize outputSize;
|
|
|
private OutputImage image;
|
|
|
- private Projection2DTo2D projection;
|
|
|
+ private Projection2DTo2D projection1;
|
|
|
+ private Projection3DTo3D projection2;
|
|
|
private Vector2D currentCalibrationPoint;
|
|
|
private bool calibrationImageUpToDate;
|
|
|
private Random rand;
|
|
@@ -44,7 +45,8 @@ namespace bbiwarg.Output.GlassesOutput
|
|
|
|
|
|
rand = new Random();
|
|
|
currentCalibrationPoint = getRandomOutputPoint();
|
|
|
- projection = new Projection2DTo2D(inputSize, outputSize, Parameters.GlassesWindowNumCalibrationPoints);
|
|
|
+ projection1 = new Projection2DTo2D(inputSize, outputSize, Parameters.GlassesWindowNumCalibrationPoints);
|
|
|
+ projection2 = new Projection3DTo3D(inputSize, outputSize, Parameters.GlassesWindowNumCalibrationPoints);
|
|
|
|
|
|
Name = name;
|
|
|
Text = name;
|
|
@@ -75,7 +77,7 @@ namespace bbiwarg.Output.GlassesOutput
|
|
|
if (!inputProvider.IsActive)
|
|
|
Close();
|
|
|
|
|
|
- if (projection.IsCalibrated)
|
|
|
+ if (projection1.IsCalibrated)
|
|
|
{
|
|
|
FrameData frameData = inputHandler.FrameData;
|
|
|
if (frameData != null)
|
|
@@ -119,17 +121,17 @@ namespace bbiwarg.Output.GlassesOutput
|
|
|
foreach (Palm palm in frameData.TrackedPalms)
|
|
|
{
|
|
|
Quadrangle quadInput = palm.Quad;
|
|
|
- Vector2D a = projection.projectPoint(quadInput.TopLeft);
|
|
|
- Vector2D b = projection.projectPoint(quadInput.TopRight);
|
|
|
- Vector2D c = projection.projectPoint(quadInput.BottomRight);
|
|
|
- Vector2D d = projection.projectPoint(quadInput.BottomLeft);
|
|
|
+ Vector2D a = projection1.projectPoint(quadInput.TopLeft);
|
|
|
+ Vector2D b = projection1.projectPoint(quadInput.TopRight);
|
|
|
+ Vector2D c = projection1.projectPoint(quadInput.BottomRight);
|
|
|
+ Vector2D d = projection1.projectPoint(quadInput.BottomLeft);
|
|
|
Quadrangle quadOutput = new Quadrangle(a, b, c, d);
|
|
|
image.drawQuadrangleGrid(quadOutput, Color.Yellow, Color.Orange, 3, 4);
|
|
|
}
|
|
|
|
|
|
foreach (Finger finger in frameData.TrackedFingers)
|
|
|
{
|
|
|
- Vector2D tipProjected = projection.projectPoint(finger.TipPoint);
|
|
|
+ Vector2D tipProjected = projection1.projectPoint(finger.TipPoint);
|
|
|
image.fillCircle(tipProjected, 10, Color.Yellow);
|
|
|
}
|
|
|
|
|
@@ -167,8 +169,10 @@ namespace bbiwarg.Output.GlassesOutput
|
|
|
{
|
|
|
Vector2D pointOutput = currentCalibrationPoint;
|
|
|
Vector2D pointInput = frameData.TrackedFingers[0].TipPoint;
|
|
|
+ Vector3D point3D = inputHandler.CoordinateConverter.convertCoordinate2Dto3D(pointInput, frameData.DepthImage.getDepthAt(pointInput));
|
|
|
|
|
|
- projection.addCalibrationPoints(pointInput, pointOutput);
|
|
|
+ projection1.addCalibrationPoints(pointInput, pointOutput);
|
|
|
+ projection2.addCalibrationPoints(point3D, pointInput, pointOutput);
|
|
|
|
|
|
currentCalibrationPoint = getRandomOutputPoint();
|
|
|
}
|
|
@@ -177,7 +181,7 @@ namespace bbiwarg.Output.GlassesOutput
|
|
|
}
|
|
|
else if (e.KeyCode == Keys.R)
|
|
|
{
|
|
|
- projection.reset();
|
|
|
+ projection1.reset();
|
|
|
currentCalibrationPoint = getRandomOutputPoint();
|
|
|
}
|
|
|
}
|