Constants.cs 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace bbiwarg
  8. {
  9. class Constants
  10. {
  11. // BBIWARG
  12. public static readonly int OutputNumImages = 5;
  13. public static readonly int OutputNumImagesPerRow = 3;
  14. public static readonly float OutputScaleFactor = 1f; // output window size is scaled by this factor (from necessary size for images)
  15. // debug
  16. public static readonly bool OutputTimerEnabled = false;
  17. public static readonly bool VerboseTUIO = false;
  18. public static readonly bool VerboseFingerTracker = true;
  19. // confidence image
  20. public static readonly int ConfidenceImageMinThreshold = 500;
  21. // depth image
  22. public static readonly int DepthImageMedianSize = 3;
  23. public static readonly int DepthImageDepthRange = 200; // <255
  24. // edge image
  25. public static readonly int EdgeImageCannyStartThreshold = 100;
  26. public static readonly int EdgeImageCannyLinkingThreshold = 75;
  27. public static readonly int EdgeImageCannySize = 3;
  28. public static readonly int EdgeImageRoughNumDilationIterations = 1;
  29. // finger detection
  30. public static readonly int FingerStepSize = 2;
  31. public static readonly int FingerMinNumSlices = 30 / FingerStepSize;
  32. public static readonly int FingerRemoveNumSlicesForCorrection = 5;
  33. public static readonly int FingerMaxGapCounter = 5;
  34. public static readonly int FingerMaxSliceDifferencePerStep = 5;
  35. public static readonly int FingerMaxSize = 30;
  36. public static readonly int FingerMinSize = 5;
  37. public static readonly int FingerNumSlicesForRelativeDirection = FingerRemoveNumSlicesForCorrection;
  38. public static readonly int FingerNumFramesUntilTracked = 5;
  39. public static readonly int FingerNumFramesUntilLost = 20;
  40. public static readonly int FingerOutSliceFactor = 10;
  41. public static readonly int FingerContourMargin = 2;
  42. public static readonly int FingerSliceOverlapFactor = 2;
  43. public static readonly int FingerCrippleOutFactor = 8;
  44. public static readonly int FingerCrippleOutMinDifference = 15;
  45. public static readonly float FingerMinSimilarityForTracking = 0.1f;
  46. // hand detection
  47. public static readonly float HandMaxSize = 0.7f;
  48. // palm detection
  49. public static readonly float PalmMinDefectMidFingerLineDistance = 20; // defects with mid point ((start + end) / 2) closer than this to a finger line are removed
  50. public static readonly float PalmMaxThumbDefectAngle = 110; // degree
  51. public static readonly float PalmMaxThumbDefectStartEndLengthQuotient = 2.3f;
  52. public static readonly float PalmMinThumbDefectStartEndLengthQuotient = 1.2f;
  53. public static readonly float PalmMinTumbDefectDepthThumbLengthQuotient = 0.8f;
  54. public static readonly float PalmMaxTumbDefectDepthThumbLengthQuotient = 1.2f;
  55. public static readonly float PalmThumbDefectmXX = 50.0f;
  56. public static readonly float PalmThumbDefectmXY = -25.0f;
  57. public static readonly float PalmThumbDefectmYY = 50.0f;
  58. public static readonly float PalmThumbDefectProcessNoise = 5.0e+1f;
  59. public static readonly int PalmNumFramesNoHandReset = 5;
  60. public static readonly float PalmMinAreaQuotient = 0.6f;
  61. public static readonly float PalmMaxAreaQuotient = 1.4f;
  62. //palm Grid
  63. public static readonly int PalmGridRows = 3;
  64. public static readonly int PalmGridColumns = 3;
  65. // touch detection
  66. public static readonly float TouchEventMinFloodValue = 0.2f;
  67. public static readonly int TouchEventTipCorrectionFactor = 7;
  68. public static readonly int TouchEventAreaSize = 25;
  69. public static readonly int TouchEventNumFramesUntilTracked = 2;
  70. public static readonly float TouchmXX = 0.005481396f;
  71. public static readonly float TouchmXY = 0.0003090923f;
  72. public static readonly float TouchmYY = 0.0005702336f;
  73. public static readonly float TouchProcessNoise = 3.0e-4f;
  74. // colors
  75. public static readonly Color ColorDetected = Color.Turquoise;
  76. public static readonly Color ColorTracked = Color.Yellow;
  77. //public static readonly Color EdgeColor = Color.Blue; // edgeImage draw direct to blue chanel from outputImage
  78. public static readonly Color FingerSliceColor = Color.Magenta;
  79. public static readonly Color FingerDetectedColor = ColorDetected;
  80. public static readonly Color FingerTrackedColor = ColorTracked;
  81. public static readonly Color FingerTipOutSliceColor = Color.Orange;
  82. public static readonly Color FingerHandOutSliceColor = Color.DarkSlateGray;
  83. public static readonly Color FingerContourColor = Color.Red;
  84. public static readonly Color TouchEventDetectedColor = ColorDetected;
  85. public static readonly Color TouchEventTrackedColor = ColorTracked;
  86. public static readonly Color TouchEventTipColor = Color.CornflowerBlue;
  87. public static readonly Color TouchEventAreaMatchedSubtractColor = Color.DarkOrange;
  88. public static readonly Color TouchEventAreaNonMatchedSubtractColor = Color.DarkSlateGray;
  89. public static readonly Color TouchEventStatusBarColor = Color.Green;
  90. public static readonly Color TouchEventVisualizerLineColor = Color.White;
  91. public static readonly Color TouchEventVisualizerPointColor = Color.Red;
  92. public static readonly Color PalmQuadColor = Color.Blue;
  93. public static readonly Color PalmGridColor = Color.CornflowerBlue;
  94. public static readonly Color PalmConturColor = Color.Red;
  95. public static readonly Color PalmConvexHullColor = Color.Green;
  96. public static readonly Color PalmThumbDefectColor = Color.Lime;
  97. }
  98. }