Constants.cs 4.4 KB

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