public void Compute(FrameData data)
 {
     if (data.Rotation < -TRESHOLD)
     {
         gatherer.PushGesture(GestureGatherer.GestureType.HEAD_ROTATION_LEFT, data.Epoch);
     }
     if (data.Rotation > TRESHOLD)
     {
         gatherer.PushGesture(GestureGatherer.GestureType.HEAD_ROTATION_RIGHT, data.Epoch);
     }
 }
Beispiel #2
0
        public void Compute(FrameData data)
        {
            Rectangle rect = data.Mouth.rect;

            if (rect.Height != 0 && rect.Width != 0)
            {
                rect.X += data.MouthROI.X;
                rect.Y += data.MouthROI.Y;
                Emgu.CV.Image <Gray, byte> mouth = data.GrayFrame.GetSubRect(rect);
                mouth._ThresholdToZero(new Gray(100));
                mouth._SmoothGaussian(3);
                mouth._Erode(4);
                Gray      avg = new Gray();
                MCvScalar sdv = new MCvScalar();
                mouth.AvgSdv(out avg, out sdv);
                if (avg.Intensity < 150)
                {
                    gatherer.PushGesture(GestureGatherer.GestureType.MOUTH_OPENED, data.Epoch);
                }
            }
        }