Click here to Skip to main content
15,894,017 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I am using this code for face detection but there is in var faces=


C#
Image<Bgr, Byte> ImageFrame = capture.QueryFrame();

if (ImageFrame != null)   // confirm that image is valid
{
   //STEP 4.1-convert the image to gray scale
   Image<Gray, byte> grayframe = ImageFrame.Convert<Gray, byte>();

   MCvAvgComp[] faces = grayframe.DetectHaarCascade(haar, 1.4, 4,
      HAAR_DETECTION_TYPE.DO_CANNY_PRUNING,
      new Size(25, 25))[0];

   foreach (var face in faces)
   {
      ImageFrame.Draw(face.rect, new Bgr(Color.Green), 3);
   }
}
imageBox1.Image = ImageFrame;

pictureBox1.Image = ImageFrame.ToBitmap();
ImageFrame.Save(@"E:\9\MyPic.jpg");

//haar = new HaarCascade("haarcascade_frontalface_alt_tree.xml");


Code block and tabulation
Posted
Updated 15-Mar-14 11:51am
v3

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900