Bitmap imgs = (Bitmap)pictureBox1.Image.Clone(); Image<Bgr, Byte> currentframe = new Image<Bgr, byte>(imgs); // Image<Bgr, Byte> currentframe = new Image<Bgr, byte>("D://bs//image processing//image processing//images//3.jpg"); String facefile = "haarcascade_frontalface_default.xml"; using (HaarCascade face = new HaarCascade(facefile)) { using (Image<Gray, Byte> grey = currentframe.Convert<Gray, Byte>()) { grey._EqualizeHist(); MCvAvgComp[] facedetected = face.Detect(grey, 1.1, 10, Emgu.CV.CvEnum.HAAR_DETECTION_TYPE.DO_CANNY_PRUNING, new Size(20, 20)); foreach (MCvAvgComp f in facedetected) { currentframe.Draw(f.rect, new Bgr(Color.Blue), 2); grey.ROI = f.rect; } } } // ImageViewer.Show(currentframe); pictureBox1.Image = currentframe.ToBitmap(); // MessageBox.Show("successfully image drawed");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)