public FaceAnalyzerService() { _cascadeClassifier = new CascadeClassifier(@"haarcascade_frontalface_alt_tree.xml"); _context = new KataskopeyaContext(); _recognitionEngine = new RecognizerEngine(@"trainningData.YAML"); //Task.Run(() => _recognitionEngine.TrainRecognizer()).Wait(); }
private void ucAddTrainedImage_Load(object sender, EventArgs e) { loadGridView(); loadListImage(); _recognizerEngine = new RecognizerEngine(storeImagePath, 1); bckGroundTrainer.RunWorkerAsync(); }
public Form1() { InitializeComponent(); EmguSingleton.Instance.SetUp ( FaceHaarCascadePath, EyeHaarCascadePath, DetectorDataPath ); #region CustomDataBindings /*userNameTextBox.DataBindings.Add(new Binding("Text", loggedInUser, "Name")); //since there is no 'loggedinuser' initially these values cant be bound - uncomment after we have a login which sets it * userBioTextBox.DataBindings.Add(new Binding("Text", loggedInUser, "Bio")); * userLikesTextBox.DataBindings.Add(new Binding("Text", loggedInUser, "Likes"));*/ userDebugNameCombo.SelectedIndex = -1; userDebugNameCombo.DataSource = new BindingSource(Storage.People, ""); userDebugNameCombo.DisplayMember = "Name"; userDebugNameCombo.SelectedIndexChanged += (IChannelSender, args) => { loggedInUser = (Person)userDebugNameCombo.SelectedItem; userNameTextBox.DataBindings.Clear(); userBioTextBox.DataBindings.Clear(); userLikesTextBox.DataBindings.Clear(); userNameTextBox.DataBindings.Add(new Binding("Text", loggedInUser, "Name")); userBioTextBox.DataBindings.Add(new Binding("Text", loggedInUser, "Bio")); userLikesTextBox.DataBindings.Add(new Binding("Text", loggedInUser, "Likes")); UtilStatic.SetupUserPicturePanel(panel: userPicturePanel, user: loggedInUser); //named parameters - reverse order to the declaration }; cmbNames.SelectedIndex = -1; cmbNames.DataSource = new BindingSource(Storage.People, ""); cmbNames.DisplayMember = "Name"; cmbNames.SelectedIndexChanged += (IChannelSender, args) => { lblInfoAboutName.Text = "Aprašymas: " + ((Person)cmbNames.SelectedItem).Bio + Environment.NewLine + "Pomėgiai: " + ((Person)cmbNames.SelectedItem).Likes; }; #endregion engine = new RecognizerEngine("", YMLPath); FaceRecognition = engine._faceRecognizer; //new EigenFaceRecognizer(80, double.PositiveInfinity); if (File.Exists(YMLPath) && new FileInfo(YMLPath).Length > 0) { FaceRecognition.Read(YMLPath); } FaceDetection = new CascadeClassifier(Application.StartupPath + @"\Recognition\HaarClassifiers\haarcascade_frontalface_default.xml"); EyeDetection = new CascadeClassifier(Application.StartupPath + @"\Recognition\HaarClassifiers\haarcascade_eye.xml"); Frame = new Mat(); Faces = new List <Image <Gray, byte> >(); IDs = new List <int>(); InitWebcam(); }
public MonitoringControlViewModel() { db = new SqliteHelper(); string recognizerPath = AppDomain.CurrentDomain.BaseDirectory + "recognizer.YAML"; _engine = new RecognizerEngine(recognizerPath); _engine.TrainRecognizer(); }
public ucXCam() { InitializeComponent(); hDAO = new HistoryDAO(); camDAO = new CameraDAO(); fDAO = new FaceDAO(); pDAO = new PeopleDAO(); #region [Khởi tạo camera] _recognizerEngine = new RecognizerEngine(_trainerDataPath, 1); _recognizerEngineunKnow = new RecognizerEngine(_trainerDataPath, 2); _cascadeClassifier = new CascadeClassifier("haarcascade_frontalface_default.xml"); #endregion }
public FaceScannerViewModel() { PanelsVisability = Visibility.Visible; SpinnerVisability = Visibility.Hidden; ThumbUpVisability = Visibility.Hidden; _recognizerEngine = new RecognizerEngine(@"trainningData.YAML"); _faceImageProcessor = new FaceImageProcessor(); _faceScannerService = new FaceScannerService(); PreviousWindowCommand = new RelayCommand(GetToPreviousWindow); StartScanCommand = new RelayCommand(StartScan); CreateUserStations(); _currentStation = _stations.First(); UserMessage = _currentStation.Message; Directory.CreateDirectory(FileSystemPaths.ScannerOutput); IsScanButtonEnabled = true; }