public void TestFaceDetect() { using (Image <Bgr, Byte> image = new Image <Bgr, byte>("lena.jpg")) using (Image <Bgr, Byte> smooth = image.SmoothGaussian(7)) { DateTime t1 = DateTime.Now; FaceDetector fd = new FaceDetector(); Face f = fd.Detect(smooth)[0]; TimeSpan ts = DateTime.Now.Subtract(t1); Trace.WriteLine(ts.TotalMilliseconds); Eye e = f.DetectEye()[0]; //Application.Run(new ImageViewer(e.RGB)); /* * Image<Rgb, Byte> res = f.RGB.BlankClone(); * res.Draw(f.SkinContour, new Rgb(255.0, 255.0, 255.0), new Rgb(255.0, 255.0, 255.0), -1); * Application.Run(new ImageViewer(res.ToBitmap())); */ } }
public void TestFaceDetect() { using (Image<Bgr, Byte> image = new Image<Bgr, byte>("lena.jpg")) using (Image<Bgr, Byte> smooth = image.SmoothGaussian(7)) { DateTime t1 = DateTime.Now; FaceDetector fd = new FaceDetector(); Face f = fd.Detect(smooth)[0]; TimeSpan ts = DateTime.Now.Subtract(t1); Trace.WriteLine(ts.TotalMilliseconds); Eye e = f.DetectEye()[0]; //Application.Run(new ImageViewer(e.RGB)); /* Image<Rgb, Byte> res = f.RGB.BlankClone(); res.Draw(f.SkinContour, new Rgb(255.0, 255.0, 255.0), new Rgb(255.0, 255.0, 255.0), -1); Application.Run(new ImageViewer(res.ToBitmap())); */ } }