|
@@ -43,7 +43,7 @@ namespace bbiwarg.Detectors.Touch
|
|
|
float y = HelperFunctions.thresholdRange<float>(0, depthImage.Height - 1, tipPoint.Y + directionFactor * direction.Y);
|
|
|
Vector2D tep = new Vector2D(x, y);
|
|
|
|
|
|
- outputImage.fillCircle(tep.IntX, tep.IntY, 5, Color.Orange);
|
|
|
+ outputImage.fillCircle(tep.IntX, tep.IntY, 5, Constants.TouchEventDetectedColor);
|
|
|
TouchEvent touchEvent = new TouchEvent(tep, floodValue, finger);
|
|
|
TouchEvents.Add(touchEvent);
|
|
|
}
|
|
@@ -70,12 +70,18 @@ namespace bbiwarg.Detectors.Touch
|
|
|
{
|
|
|
Int16 depth = depthImage.getDepthAt(x, y);
|
|
|
Color color = outputImage.getColotAt(x, y);
|
|
|
- outputImage.drawPixel(x, y, Color.FromArgb(color.R / 2, color.G / 2, color.B / 2));
|
|
|
+ Color subtractColor;
|
|
|
if (Math.Abs(depthAtTouch - depth) < maxDepthDifference)
|
|
|
{
|
|
|
matchedPixels++;
|
|
|
- outputImage.drawPixel(x, y, Color.FromArgb(color.R / 2, color.G / 2, color.B));
|
|
|
+ subtractColor = Constants.TouchEventAreaMatchedSubtractColor;
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ subtractColor = Constants.TouchEventAreaNonMatchedSubtractColor;
|
|
|
+ }
|
|
|
+ Color newColor = Color.FromArgb(Math.Max(color.R - subtractColor.R, 0), Math.Max(color.G - subtractColor.G, 0), Math.Max(color.B - subtractColor.B, 0));
|
|
|
+ outputImage.drawPixel(x, y, newColor);
|
|
|
countedPixels++;
|
|
|
}
|
|
|
}
|
|
@@ -85,7 +91,7 @@ namespace bbiwarg.Detectors.Touch
|
|
|
//status bar (% of matched pixels) -> green
|
|
|
for (int x = minX; x < minX + (maxX - minX) * rel; x++)
|
|
|
{
|
|
|
- outputImage.drawPixel(x, maxY - 1, Color.Yellow);
|
|
|
+ outputImage.drawPixel(x, maxY - 1, Constants.TouchEventStatusBarColor);
|
|
|
}
|
|
|
|
|
|
return rel;
|