Constants.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 bool OutputTimerEnabled = true;
  13. public static readonly int OutputNumImages = 5;
  14. public static readonly int OutputNumImagesPerRow = 3;
  15. public static readonly float OutputScaleFactor = 1f; // output window size is scaled by this factor (from necessary size for images)
  16. // confidence image
  17. public static readonly int ConfidenceImageMinThreshold = 500;
  18. // depth image
  19. public static readonly int DepthImageMedianSize = 3;
  20. public static readonly int DepthImageDepthRange = 200; // <255
  21. // edge image
  22. public static readonly int EdgeImageCannyStartThreshold = 100;
  23. public static readonly int EdgeImageCannyLinkingThreshold = 75;
  24. public static readonly int EdgeImageCannySize = 3;
  25. public static readonly int EdgeImageRoughNumDilationIterations = 1;
  26. // finger detection
  27. public static readonly int FingerStepSize = 2;
  28. public static readonly int FingerMinNumSlices = 30 / FingerStepSize;
  29. public static readonly int FingerRemoveNumSlicesForCorrection = 5;
  30. public static readonly int FingerMaxGapCounter = 10;
  31. public static readonly int FingerMaxSliceDifferencePerStep = 5;
  32. public static readonly int FingerMaxSize = 30;
  33. public static readonly int FingerMinSize = 5;
  34. public static readonly int FingerNumSlicesForRelativeDirection = FingerRemoveNumSlicesForCorrection;
  35. public static readonly int FingerNumFramesUntilTracked = 2;
  36. public static readonly int FingerOutSliceFactor = 10;
  37. public static readonly int FingerContourMargin = 2;
  38. public static readonly int FingerSliceOverlapFactor = 2;
  39. public static readonly float FingerMinSimilarityForTracking = 0.75f;
  40. // hand detection
  41. public static readonly float HandMaxSize = 0.7f;
  42. // palm detection
  43. public static readonly float PalmMinDefectMidFingerLineDistance = 20; // defects with mid point ((start + end) / 2) closer than this to a finger line are removed
  44. public static readonly float PalmMaxThumbDefectAngle = 110; // degree
  45. public static readonly float PalmMaxThumbDefectLengthQuotient = 2.2f;
  46. public static readonly float PalmMinThumbDefectLengthQuotient = 1.2f;
  47. public static readonly float PalmMinTumbDefectDepth = 30.0f;
  48. //palm Grid
  49. public static readonly int PalmGridRows = 4;
  50. public static readonly int PalmGridColumns = 3;
  51. // touch detection
  52. public static readonly float TouchEventMinFloodValue = 0.2f;
  53. public static readonly int TouchEventTipCorrectionFactor = 7;
  54. public static readonly int TouchEventAreaSize = 30;
  55. public static readonly int TouchEventNumFramesUntilTracked = 2;
  56. // colors
  57. public static readonly Color ColorDetected = Color.Green;
  58. public static readonly Color ColorTracked = Color.LightGoldenrodYellow;
  59. //public static readonly Color EdgeColor = Color.Blue; // edgeImage draw direct to blue chanel from outputImage
  60. public static readonly Color FingerSliceColor = Color.Magenta;
  61. public static readonly Color FingerDetectedColor = ColorDetected;
  62. public static readonly Color FingerTrackedColor = ColorTracked;
  63. public static readonly Color FingerTipOutSliceColor = Color.Gray;
  64. public static readonly Color FingerHandOutSliceColor = Color.DarkSlateGray;
  65. public static readonly Color TouchEventDetectedColor = ColorDetected;
  66. public static readonly Color TouchEventTrackedColor = ColorTracked;
  67. public static readonly Color TouchEventTipColor = Color.CornflowerBlue;
  68. public static readonly Color TouchEventAreaMatchedSubtractColor = Color.DarkOrange;
  69. public static readonly Color TouchEventAreaNonMatchedSubtractColor = Color.DarkSlateGray;
  70. public static readonly Color TouchEventStatusBarColor = Color.Green;
  71. public static readonly Color TouchEventVisualizerLineColor = Color.White;
  72. public static readonly Color TouchEventVisualizerPointColor = Color.Red;
  73. public static readonly Color PalmQuadColor = Color.Blue;
  74. public static readonly Color PalmGridColor = Color.CornflowerBlue;
  75. public static readonly Color PalmConturColor = Color.Red;
  76. public static readonly Color PalmConvexHullColor = Color.Green;
  77. public static readonly Color PalmThumbDefectColor = Color.Lime;
  78. }
  79. }