private void Run() { try { VideoCapture = new VideoCapture(); VideoCapture.SetCaptureProperty(Emgu.CV.CvEnum.CapProp.FrameHeight, 720); VideoCapture.SetCaptureProperty(Emgu.CV.CvEnum.CapProp.FrameWidth, 1280); FrontalFaceCascadeClassifier = new CascadeClassifier(Application.StartupPath + Config.FaceHaarCascadeFilePath); RecognizerEngine = new RecognizerEngine(Config.DatabaseFilePath, Config.TrainingDataFilePath); DataStore = new DataStoreAccess(Config.DatabaseFilePath); FacesDetectorTimer = new System.Timers.Timer(); FacesDetectorTimer.Interval = Config.FacesDetectorInterval; FacesDetectorTimer.Elapsed += FacesDetectorElapsed; FacesDetectorTimer.Start(); FacesRecognizerTimer = new System.Timers.Timer(); FacesRecognizerTimer.Interval = Config.FacesRecognizerInterval; FacesRecognizerTimer.Elapsed += FacesRecognizerElapsed; FacesRecognizerTimer.Start(); IsBrowserOpen = false; FacesDetected = false; Users = new List <User>(); Application.Idle += ProcessFrame; } catch (Exception) { // TODO: Log Application.Exit(); } }
//public FaceBot(string pathVideo) //{ // CheckForIllegalCrossThreadCalls = false; // InitializeComponent(); // PathVideo= pathVideo; // Run(); //} private void Run() { try { //VideoCapture = new VideoCapture(Emgu.CV.CvEnum.CaptureType.Openni2); //VideoCapture = new VideoCapture(@"C:\Users\Carlos\Videos\VID_20180811_144136.mp4"); string ruta = Path.GetTempPath() + @"\recVid.mp4"; VideoCapture = new VideoCapture(ruta); //VideoCapture = new VideoCapture(@"C:\Users\Carlos\Videos\VID_20180811_144136.mp4"); VideoCapture.SetCaptureProperty(Emgu.CV.CvEnum.CapProp.FrameHeight, 720); VideoCapture.SetCaptureProperty(Emgu.CV.CvEnum.CapProp.FrameWidth, 1280); FrontalFaceCascadeClassifier = new CascadeClassifier(Application.StartupPath + Config.FaceHaarCascadeFilePath); RecognizerEngine = new RecognizerEngine(Config.DatabaseFilePath, Config.TrainingDataFilePath); DataStore = new DataStoreAccess(Config.DatabaseFilePath); //no se que hace este hilo :| FacesDetectorTimer = new System.Timers.Timer(); FacesDetectorTimer.Interval = Config.FacesDetectorInterval; FacesDetectorTimer.Elapsed += FacesDetectorElapsed; FacesDetectorTimer.Start(); FacesRecognizerTimer = new System.Timers.Timer(); FacesRecognizerTimer.Interval = Config.FacesRecognizerInterval; FacesRecognizerTimer.Elapsed += FacesRecognizerElapsed; FacesRecognizerTimer.Start(); FacesDetected = false; Users = new List <User>(); Application.Idle += ProcessFrame; } catch (Exception) { // TODO: Log Application.Exit(); } }