|
@@ -12,41 +12,42 @@ namespace bbiwarg
|
|
{
|
|
{
|
|
public enum InputType
|
|
public enum InputType
|
|
{
|
|
{
|
|
- Camera = 0,
|
|
|
|
- Movie = 1
|
|
|
|
|
|
+ Camera,
|
|
|
|
+ Movie
|
|
}
|
|
}
|
|
|
|
|
|
class Parameters
|
|
class Parameters
|
|
{
|
|
{
|
|
// input
|
|
// input
|
|
- public static readonly InputType InputSource = InputType.Camera;
|
|
|
|
|
|
+ public static readonly InputType InputSource = InputType.Movie;
|
|
public static readonly String InputMoviePath = "..\\..\\videos\\touch\\4.skv";
|
|
public static readonly String InputMoviePath = "..\\..\\videos\\touch\\4.skv";
|
|
|
|
|
|
// Logger
|
|
// Logger
|
|
- public static readonly LogSubject LogLevel = LogSubject.None;
|
|
|
|
|
|
+ public static readonly LogSubject EnabledLogSubjects = LogSubject.None;
|
|
public static readonly int ConsoleWidth = 90;
|
|
public static readonly int ConsoleWidth = 90;
|
|
public static readonly int ConsoleHeight = 30;
|
|
public static readonly int ConsoleHeight = 30;
|
|
|
|
|
|
- // Output
|
|
|
|
- public static readonly int OutputUpdateRate = 30;
|
|
|
|
- public static readonly int OutputRenderRate = 30;
|
|
|
|
- public static readonly int OutputNumImages = 5;
|
|
|
|
- public static readonly int OutputNumImagesPerRow = 3;
|
|
|
|
- public static readonly float OutputScaleFactor = 1f; // output window size is scaled by this factor (from necessary size for images)
|
|
|
|
- public static readonly String OutputTitle = "BBIWARG - Output";
|
|
|
|
|
|
+ // Debug-Output
|
|
|
|
+ public static readonly bool DebugOutputEnabled = true;
|
|
|
|
+ public static readonly int DebugOutputUpdateRate = 30;
|
|
|
|
+ public static readonly int DebugOutputRenderRate = 30;
|
|
|
|
+ public static readonly int DebugOutputNumImages = 5;
|
|
|
|
+ public static readonly int DebugOutputNumImagesPerRow = 3;
|
|
|
|
+ public static readonly float DebugOutputScaleFactor = 1f; // output window size is scaled by this factor (from necessary size for images)
|
|
|
|
+ public static readonly String DebugOutputTitle = "BBIWARG - DebugOutput";
|
|
|
|
|
|
// TUIO
|
|
// TUIO
|
|
- public static bool TuioEnabled = true;
|
|
|
|
- public static IPAddress TuioIP = new IPAddress(new byte[4] { 127, 0, 0, 1 });
|
|
|
|
- public static Int16 TuioPort = 3333;
|
|
|
|
|
|
+ public static bool TuioEnabled { get; private set; }
|
|
|
|
+ public static IPAddress TuioIP { get; private set; }
|
|
|
|
+ public static Int16 TuioPort { get; private set; }
|
|
|
|
|
|
// image
|
|
// image
|
|
- public static readonly int ImageWidth = 320;
|
|
|
|
- public static readonly int ImageHeight = 240;
|
|
|
|
- public static readonly int ImageNumPixels = ImageWidth * ImageHeight;
|
|
|
|
- public static readonly Vector2D ImageMaxPixel = new Vector2D(ImageWidth - 1, ImageHeight - 1);
|
|
|
|
- public static readonly float ImageDiagonalLength = ImageMaxPixel.Length;
|
|
|
|
- public static readonly float ImageAspectRatio = (float)ImageWidth / (float)ImageHeight;
|
|
|
|
|
|
+ public static int ImageWidth { get; private set; }
|
|
|
|
+ public static int ImageHeight { get; private set; }
|
|
|
|
+ public static int ImageNumPixels { get; private set; }
|
|
|
|
+ public static Vector2D ImageMaxPixel { get; private set; }
|
|
|
|
+ public static float ImageDiagonalLength { get; private set; }
|
|
|
|
+ public static float ImageAspectRatio { get; private set; }
|
|
|
|
|
|
// confidence image
|
|
// confidence image
|
|
public static readonly int ConfidenceImageMinThreshold = 500;
|
|
public static readonly int ConfidenceImageMinThreshold = 500;
|
|
@@ -61,6 +62,9 @@ namespace bbiwarg
|
|
public static readonly int EdgeImageCannySize = 3;
|
|
public static readonly int EdgeImageCannySize = 3;
|
|
public static readonly int EdgeImageRoughNumDilationIterations = 1;
|
|
public static readonly int EdgeImageRoughNumDilationIterations = 1;
|
|
|
|
|
|
|
|
+ // general tracking
|
|
|
|
+ public static readonly float TrackerMaxRelativeMove = 0.25f;
|
|
|
|
+
|
|
// finger detection
|
|
// finger detection
|
|
public static readonly int FingerStepSize = 1;
|
|
public static readonly int FingerStepSize = 1;
|
|
public static readonly int FingerMaxGapCounter = 3;
|
|
public static readonly int FingerMaxGapCounter = 3;
|
|
@@ -77,12 +81,12 @@ namespace bbiwarg
|
|
// finger tracking
|
|
// finger tracking
|
|
public static readonly int FingerTrackerNumFramesDetectedUntilTracked = 5;
|
|
public static readonly int FingerTrackerNumFramesDetectedUntilTracked = 5;
|
|
public static readonly int FingerTrackerNumFramesLostUntilDeleted = 10;
|
|
public static readonly int FingerTrackerNumFramesLostUntilDeleted = 10;
|
|
- public static readonly float FingerTrackerMaxTipPointMove = 0.25f * ImageDiagonalLength;
|
|
|
|
- public static readonly float FingerTrackerMaxHandPointMove = 0.25f * ImageDiagonalLength;
|
|
|
|
public static readonly float FingermXX = 0.000005f;
|
|
public static readonly float FingermXX = 0.000005f;
|
|
public static readonly float FingermXY = 0.0f;
|
|
public static readonly float FingermXY = 0.0f;
|
|
public static readonly float FingermYY = 0.000005f;
|
|
public static readonly float FingermYY = 0.000005f;
|
|
public static readonly int FingerTrackerNumDirectionsForMeanDirection = 10;
|
|
public static readonly int FingerTrackerNumDirectionsForMeanDirection = 10;
|
|
|
|
+ public static readonly float FingerTrackerMaxTipPointRelativeMove = TrackerMaxRelativeMove;
|
|
|
|
+ public static readonly float FingerTrackerMaxHandPointRelativeMove = TrackerMaxRelativeMove;
|
|
|
|
|
|
// hand detection
|
|
// hand detection
|
|
public static readonly int HandNumColors = 3;
|
|
public static readonly int HandNumColors = 3;
|
|
@@ -101,7 +105,7 @@ namespace bbiwarg
|
|
// hand tracker
|
|
// hand tracker
|
|
public static readonly int HandTrackerNumFramesDetectedUntilTracked = 5;
|
|
public static readonly int HandTrackerNumFramesDetectedUntilTracked = 5;
|
|
public static readonly int HandTrackerNumFramesLostUntilDeleted = 5;
|
|
public static readonly int HandTrackerNumFramesLostUntilDeleted = 5;
|
|
- public static readonly float HandTrackerMaxCentroidMove = 0.25f * ImageDiagonalLength;
|
|
|
|
|
|
+ public static readonly float HandTrackerMaxCentroidRelativeMove = TrackerMaxRelativeMove;
|
|
public static readonly float HandmXX = 0.0005f;
|
|
public static readonly float HandmXX = 0.0005f;
|
|
public static readonly float HandmXY = 0.0f;
|
|
public static readonly float HandmXY = 0.0f;
|
|
public static readonly float HandmYY = 0.0005f;
|
|
public static readonly float HandmYY = 0.0005f;
|
|
@@ -113,17 +117,17 @@ namespace bbiwarg
|
|
// palm tracker
|
|
// palm tracker
|
|
public static readonly int PalmTrackerNumFramesDetectedUntilTracked = 5;
|
|
public static readonly int PalmTrackerNumFramesDetectedUntilTracked = 5;
|
|
public static readonly int PalmTrackerNumFramesLostUntilDeleted = 5;
|
|
public static readonly int PalmTrackerNumFramesLostUntilDeleted = 5;
|
|
- public static readonly float PalmTrackerMaxWristUpperMove = 0.25f * ImageDiagonalLength;
|
|
|
|
- public static readonly float PalmTrackerMaxWristLowerMove = 0.25f * ImageDiagonalLength;
|
|
|
|
- public static readonly float PalmTrackerMaxFingersUpperMove = 0.25f * ImageDiagonalLength;
|
|
|
|
- public static readonly float PalmTrackerMaxFingersLowerMove = 0.25f * ImageDiagonalLength;
|
|
|
|
|
|
+ public static readonly float PalmTrackerMaxWristUpperRelativeMove = TrackerMaxRelativeMove;
|
|
|
|
+ public static readonly float PalmTrackerMaxWristLowerRelativeMove = TrackerMaxRelativeMove;
|
|
|
|
+ public static readonly float PalmTrackerMaxFingersUpperRelativeMove = TrackerMaxRelativeMove;
|
|
|
|
+ public static readonly float PalmTrackerMaxFingersLowerRelativeMove = TrackerMaxRelativeMove;
|
|
public static readonly float PalmmXX = 0.00005f;
|
|
public static readonly float PalmmXX = 0.00005f;
|
|
public static readonly float PalmmXY = 0.0f;
|
|
public static readonly float PalmmXY = 0.0f;
|
|
public static readonly float PalmmYY = 0.00005f;
|
|
public static readonly float PalmmYY = 0.00005f;
|
|
|
|
|
|
//palm Grid
|
|
//palm Grid
|
|
- public static int PalmGridNumRows = 3;
|
|
|
|
- public static int PalmGridNumColumns = 4;
|
|
|
|
|
|
+ public static int PalmGridNumRows { get; private set; }
|
|
|
|
+ public static int PalmGridNumColumns { get; private set; }
|
|
|
|
|
|
// touch detection
|
|
// touch detection
|
|
public static readonly float TouchMinTouchValue = 0.3f;
|
|
public static readonly float TouchMinTouchValue = 0.3f;
|
|
@@ -136,8 +140,7 @@ namespace bbiwarg
|
|
// touch tracking
|
|
// touch tracking
|
|
public static readonly int TouchTrackerNumFramesDetectedUntilTracked = 1;
|
|
public static readonly int TouchTrackerNumFramesDetectedUntilTracked = 1;
|
|
public static readonly int TouchTrackerNumFramesLostUntilDeleted = 5;
|
|
public static readonly int TouchTrackerNumFramesLostUntilDeleted = 5;
|
|
- public static readonly float TouchTrackerMaxAbsolutePositionMove = 0.25f * ImageDiagonalLength;
|
|
|
|
- public static readonly float TouchTrackerMaxRelativePositionMove = 1f;
|
|
|
|
|
|
+ public static readonly float TouchTrackerMaxAbsolutePositionRelativeMove = TrackerMaxRelativeMove;
|
|
public static readonly float TouchmXX = 0.003f;
|
|
public static readonly float TouchmXX = 0.003f;
|
|
public static readonly float TouchmXY = 0.0f;
|
|
public static readonly float TouchmXY = 0.0f;
|
|
public static readonly float TouchmYY = 0.00165f;
|
|
public static readonly float TouchmYY = 0.00165f;
|
|
@@ -158,10 +161,9 @@ namespace bbiwarg
|
|
public static readonly Color FingerDetectedColor = ColorDetected;
|
|
public static readonly Color FingerDetectedColor = ColorDetected;
|
|
public static readonly Color FingerTrackedColor = ColorTracked;
|
|
public static readonly Color FingerTrackedColor = ColorTracked;
|
|
public static readonly Color FingerTipColor = Color.Blue;
|
|
public static readonly Color FingerTipColor = Color.Blue;
|
|
|
|
+ public static readonly Color FingerHandColor = Color.Yellow;
|
|
public static readonly Color FingerContourColor = Color.Red;
|
|
public static readonly Color FingerContourColor = Color.Red;
|
|
public static readonly Color FingerIDColor = Color.White;
|
|
public static readonly Color FingerIDColor = Color.White;
|
|
- public static readonly Color FingerPointsPredictionColor = Color.Yellow;
|
|
|
|
- public static readonly Color FingerMeanDirectionColor = Color.Red;
|
|
|
|
|
|
|
|
public static readonly Color TouchEventDetectedColor = ColorDetected;
|
|
public static readonly Color TouchEventDetectedColor = ColorDetected;
|
|
public static readonly Color TouchEventTrackedColor = ColorTracked;
|
|
public static readonly Color TouchEventTrackedColor = ColorTracked;
|
|
@@ -173,15 +175,45 @@ namespace bbiwarg
|
|
public static readonly Color TouchEventVisualizerPointColor = Color.Red;
|
|
public static readonly Color TouchEventVisualizerPointColor = Color.Red;
|
|
public static readonly Color TouchEventVisualizerGridColor = Color.White;
|
|
public static readonly Color TouchEventVisualizerGridColor = Color.White;
|
|
public static readonly Color TouchEventVisualizerTextColor = Color.White;
|
|
public static readonly Color TouchEventVisualizerTextColor = Color.White;
|
|
- public static readonly Color TouchEventVisualizerActiveBlockColor = Color.DarkSlateGray;
|
|
|
|
|
|
+ public static readonly Color TouchEventVisualizerActiveBlockColor = Color.DarkSlateGray;
|
|
|
|
|
|
public static readonly Color PalmQuadColor = Color.Blue;
|
|
public static readonly Color PalmQuadColor = Color.Blue;
|
|
public static readonly Color PalmGridColor = Color.CornflowerBlue;
|
|
public static readonly Color PalmGridColor = Color.CornflowerBlue;
|
|
|
|
|
|
- public static readonly Color[] HandColor = new Color[3] { Color.Red, Color.Blue, Color.Green };
|
|
|
|
|
|
+ public static readonly Color[] HandColors = new Color[3] { Color.Red, Color.Blue, Color.Green };
|
|
public static readonly Color HandCentroidColor = Color.Yellow;
|
|
public static readonly Color HandCentroidColor = Color.Yellow;
|
|
public static readonly Color HandIDColor = Color.White;
|
|
public static readonly Color HandIDColor = Color.White;
|
|
public static readonly Color HandThumbDefectPointColor = Color.Lime;
|
|
public static readonly Color HandThumbDefectPointColor = Color.Lime;
|
|
public static readonly Color HandThumbDefectLineColor = Color.CornflowerBlue;
|
|
public static readonly Color HandThumbDefectLineColor = Color.CornflowerBlue;
|
|
|
|
+
|
|
|
|
+ static Parameters()
|
|
|
|
+ {
|
|
|
|
+ setImageParameters(320, 240);
|
|
|
|
+ setTuioParameters(true, new IPAddress(new byte[4] { 127, 0, 0, 1 }), 3333);
|
|
|
|
+ setPalmGridParameters(3, 4);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static void setImageParameters(int width, int height)
|
|
|
|
+ {
|
|
|
|
+ ImageWidth = width;
|
|
|
|
+ ImageHeight = height;
|
|
|
|
+ ImageNumPixels = ImageWidth * ImageHeight;
|
|
|
|
+ ImageMaxPixel = new Vector2D(ImageWidth - 1, ImageHeight - 1);
|
|
|
|
+ ImageDiagonalLength = ImageMaxPixel.Length;
|
|
|
|
+ ImageAspectRatio = (float)ImageWidth / (float)ImageHeight;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static void setTuioParameters(bool enabled, IPAddress ipAddress, Int16 port)
|
|
|
|
+ {
|
|
|
|
+ TuioEnabled = enabled;
|
|
|
|
+ TuioIP = ipAddress;
|
|
|
|
+ TuioPort = port;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static void setPalmGridParameters(int numRows, int numColumns)
|
|
|
|
+ {
|
|
|
|
+ PalmGridNumRows = numRows;
|
|
|
|
+ PalmGridNumColumns = numColumns;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|