Constants.cs 4.2 KB

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