private void LoadTrainnedFace() { try { LabelList.Clear(); TrainingImages.Clear(); // Load haarcascades for face detection Face = new HaarCascade("haarcascade_frontalface_default.xml"); // Load the number of trained faces var files = GetAllFiles(Application.StartupPath + "/TrainedFaces"); TrainedFacesCounter = files.Count; foreach (var file in files) { TrainingImages.Add(new Image <Gray, byte>(file.FullName)); LabelList.Add(file.Name.Split('@')[0]); } } catch { // By pass } }
public void Clear() { TrainingImages.Clear(); MarkedTrainingImages.Clear(); RecoginzingImages.Clear(); }