Ejemplo n.º 1
0
 public FaceTracker(HumanFace face)
 {
     tracker         = new TrackerMedianFlow(10, new Size(3, 3), 5, new MCvTermCriteria(20, 0.3), new Size(30, 30));
     humanFace       = face;
     findFace        = false;
     isInit          = false;
     failFrameCount  = 0;
     FailToRecognize = false;
     missingFace     = false;
 }
Ejemplo n.º 2
0
 internal Image <Bgr, byte> drawFaceToImage(Image <Bgr, byte> bgrImage, HumanFace humanFace)
 {
     lock (bgrImage)
     {
         bgrImage.Draw(humanFace.faceRectangle, new Bgr(Color.BurlyWood), 3);
         for (var i = 0; i < humanFace.eyeRectangle.Count(); i++)
         {
             bgrImage.Draw(new Rectangle(humanFace.faceRectangle.X + humanFace.eyeRectangle[i].X, humanFace.faceRectangle.Y + humanFace.eyeRectangle[i].Y, humanFace.eyeRectangle[i].Width, humanFace.eyeRectangle[i].Height), new Bgr(Color.Green), 1);
         }
         return(bgrImage);
     }
 }