123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Net;
- using bbiwarg.Utility;
- namespace bbiwarg
- {
- public enum InputType
- {
- Camera = 0,
- Movie = 1
- }
- class Parameters
- {
- // input
- public static readonly InputType InputSource = InputType.Camera;
- public static readonly String InputMoviePath = "..\\..\\videos\\touch\\4.skv";
- // Logger
- public static readonly LogSubject LogLevel = LogSubject.None;
- public static readonly int ConsoleWidth = 90;
- 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";
- // TUIO
- public static bool TuioEnabled = true;
- public static IPAddress TuioIP = new IPAddress(new byte[4] { 127, 0, 0, 1 });
- public static Int16 TuioPort = 3333;
- // 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;
- // confidence image
- public static readonly int ConfidenceImageMinThreshold = 500;
- // depth image
- public static readonly int DepthImageMedianSize = 5;
- public static readonly int DepthImageDepthRange = 200; // <255
- // edge image
- public static readonly int EdgeImageCannyStartThreshold = 80;
- public static readonly int EdgeImageCannyLinkingThreshold = 60;
- public static readonly int EdgeImageCannySize = 3;
- public static readonly int EdgeImageRoughNumDilationIterations = 1;
- // finger detection
- public static readonly int FingerStepSize = 1;
- public static readonly int FingerMaxGapCounter = 3;
- public static readonly int FingerMaxSliceDifferencePerStep = 5;
- public static readonly int FingerMinNumSlices = 25 / FingerStepSize;
- public static readonly int FingerMaxWidth = 30;
- public static readonly int FingerMinWidth = 2;
- public static readonly int FingerRemoveNumSlicesForCorrection = 10 / FingerStepSize;
- public static readonly int FingerNumSlicesForRelativeDirection = FingerRemoveNumSlicesForCorrection;
- public static readonly int FingerOutMargin = 8;
- public static readonly int FingerMaxCrippleDifference = 20;
- public static readonly int FingerContourMargin = 4;
- // finger tracking
- public static readonly int FingerTrackerNumFramesDetectedUntilTracked = 5;
- 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.00005f;
- public static readonly float FingermXY = 0.0f;
- public static readonly float FingermYY = 0.00005f;
- public static readonly int FingerTrackerNumDirectionsForMeanDirection = 10;
- // hand detection
- public static readonly int HandNumColors = 3;
- public static readonly int HandFloodFillDownDiff = 2;
- public static readonly int HandFloodFillUpDiff = 2;
- public static readonly float HandMaxSize = 0.6f;
- public static readonly float HandMinSize = 0.01f;
- public static readonly float HandExtensionMaxSize = 0.5f * HandMaxSize;
- public static readonly int HandExtendMaxDifference = 40;
- public static readonly float HandThumbDefectMaxDistanceToThumb = FingerMaxWidth;
- public static readonly float HandThumbDefectMinThumbShortLengthRatio = 0.75f;
- public static readonly float HandThumbDefectMaxThumbShortLengthRatio = 1.1f;
- public static readonly float HandThumbDefectMinShortLongLengthRatio = 0.3f;
- public static readonly float HandThumbDefectMaxShortLongLengthRatio = 0.7f;
- // hand tracker
- public static readonly int HandTrackerNumFramesDetectedUntilTracked = 5;
- public static readonly int HandTrackerNumFramesLostUntilDeleted = 5;
- public static readonly float HandTrackerMaxCentroidMove = 0.25f * ImageDiagonalLength;
- public static readonly float HandmXX = 0.0005f;
- public static readonly float HandmXY = 0.0f;
- public static readonly float HandmYY = 0.0005f;
- // palm detection
- public static readonly int PalmNumPositionsForPalmWidth = 5;
- // palm tracker
- public static readonly int PalmTrackerNumFramesDetectedUntilTracked = 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 PalmmXX = 0.00005f;
- public static readonly float PalmmXY = 0.0f;
- public static readonly float PalmmYY = 0.00005f;
- //palm Grid
- public static int PalmGridNumRows = 3;
- public static int PalmGridNumColumns = 4;
- // touch detection
- public static readonly float TouchMinTouchValue = 0.4f;
- public static readonly int TouchAreaSize = 30;
- public static readonly int TouchFloodfillDownDiff = 0;
- public static readonly int TouchFloodfillUpDiff = 2;
- public static readonly int TouchTipInsideFactor = 2;
- public static readonly int TouchTipOutsideFactor = 10;
- // touch tracking
- public static readonly int TouchTrackerNumFramesDetectedUntilTracked = 1;
- public static readonly int TouchTrackerNumFramesLostUntilDeleted = 5;
- public static readonly float TouchTrackerMaxAbsolutePositionMove = 0.25f * ImageDiagonalLength;
- public static readonly float TouchTrackerMaxRelativePositionMove = 1f;
- public static readonly float TouchmXX = 0.003f;
- public static readonly float TouchmXY = 0.0f;
- public static readonly float TouchmYY = 0.00165f;
- public static readonly float TouchProcessNoise = 3.0e-4f;
- // touchEventVisualizer
- public static readonly int TouchEventVisualizerFadeOutTime = 1500;
- // colors
- public static readonly Color ColorDetected = Color.Turquoise;
- public static readonly Color ColorTracked = Color.Yellow;
- public static readonly Color DepthImageColor = Color.White;
- public static readonly Color EdgeImageColor = Color.Blue;
- public static readonly Color OutputImageBorderColor = Color.White;
- public static readonly Color FingerSliceColor = Color.Magenta;
- public static readonly Color FingerDetectedColor = ColorDetected;
- public static readonly Color FingerTrackedColor = ColorTracked;
- public static readonly Color FingerTipColor = Color.Blue;
- public static readonly Color FingerContourColor = Color.Red;
- 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 TouchEventTrackedColor = ColorTracked;
- public static readonly Color TouchEventAreaMatchedSubtractColor = Color.DarkOrange;
- public static readonly Color TouchEventAreaNonMatchedSubtractColor = Color.DarkSlateGray;
- public static readonly Color TouchEventStatusBarColor = Color.Green;
- public static readonly Color TouchEventVisualizerLineColor = Color.Yellow;
- public static readonly Color TouchEventVisualizerPointColor = Color.Red;
- public static readonly Color TouchEventVisualizerGridColor = Color.White;
- public static readonly Color TouchEventVisualizerTextColor = Color.White;
- public static readonly Color PalmQuadColor = Color.Blue;
- 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 HandCentroidColor = Color.Yellow;
- public static readonly Color HandIDColor = Color.White;
- public static readonly Color HandThumbDefectPointColor = Color.Lime;
- public static readonly Color HandThumbDefectLineColor = Color.CornflowerBlue;
- }
- }
|