Ejemplo n.º 1
0
 public Handetector_Threading(KinectSensor kinectSensor, int mode, Boolean isDebug)
 {
     this.kinectSensor = kinectSensor;
     colorList = new List<Color>();
     maskPlayerPos = new List<Int32>();
     dotDetector = new DotDetectorAlgorithm_Counter(detectionColor);
     r = new DotDetector_ResultObject();
     this.mode = mode;
     isDebugMode = isDebug;
 }
Ejemplo n.º 2
0
        public HandDotDetector(Rectangle redDotDetectionArea, KinectSensor k)
        {
            this.kinectSensor = k;
            this.redDotDetectionArea = redDotDetectionArea;
            results = new DotDetector_ResultObject[2];
            results[0] = new DotDetector_ResultObject();
            results[1] = new DotDetector_ResultObject();
            handPositions = new Vector2[2];
            colorList = new List<Color>();
            dotDetector = new DotDetectorAlgorithm_Counter(detectionColor);
            neededPixels = redDotDetectionArea.Width * redDotDetectionArea.Height;
            this.ready = false;

            hand_bolterValue.Add(0, 0);
            hand_bolterValue.Add(1, 0);
           

        }
Ejemplo n.º 3
0
        private void algoChangeCheck()
        {
            KeyboardState k = Keyboard.GetState();
            if (k.IsKeyDown(Keys.Q))
            {
                double oldThreshold = this.dotDetector.colorDiffrenceThreshold;
                this.dotDetector = new DotDetectorAlgorithm_Counter(detectionColor);
                this.dotDetector.colorDiffrenceThreshold = oldThreshold;
                Console.WriteLine("Dotdetectroalgorithm: Counter");

            }
            else if (k.IsKeyDown(Keys.W))
            {
                this.dotDetector = new DotDetectorAlgorithm_Average(detectionColor);
                Console.WriteLine("Dotdetectroalgorithm: Average");
            }
            else if (k.IsKeyDown(Keys.Y))
            {
                detectionColor = AbstractDotDetector.detectRedDot;
                this.dotDetector.changeDetectionColor(detectionColor);
            }
            else if (k.IsKeyDown(Keys.X))
            {
                detectionColor = AbstractDotDetector.detectGreenDot;
                this.dotDetector.changeDetectionColor(detectionColor);
            }
            else if (k.IsKeyDown(Keys.C))
            {
                detectionColor = AbstractDotDetector.detectBlueDot;
                this.dotDetector.changeDetectionColor(detectionColor);
            }

        }