private void DisposeDetector() { if (detection != null) { detection.Dispose(); detection = null; } if (inception != null) { inception.Dispose(); inception = null; } }
private void StartDetection() { if (detection == null) { detection = new FaceDetectionTests(index, detectorXml, flandModel); detection.ScreenProperties = screen; detection.GazeDetector.Calibrator.GridWidth = 3; detection.GazeDetector.Calibrator.GridHeight = 4; detection.GazeDetector.Calibrator.SampleCount = 5; detection.GazeDetector.Calibrator.Interval = 1200; detection.DetectGaze = true; } detection.Start(); }
public void FaceDetection() { FaceDetectionTests detect = null; Console.Write("Index [Press enter to detect from file] >>> "); string cmd = Console.ReadLine(); if (!string.IsNullOrEmpty(cmd)) { int ind = -1; try { ind = Convert.ToInt32(cmd); } catch { return; } detect = new FaceDetectionTests(ind, new FaceDetectorXmlLoader(), new FlandmarkModelLoader()); } else { if (DialogResult.OK == ofd.ShowDialog()) { detect = new FaceDetectionTests(ofd.FileName, new FaceDetectorXmlLoader(), new FlandmarkModelLoader()); } } if (detect != null) { detect.Detected += (obj, arg) => { }; detect.Run(); } }