コード例 #1
0
        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
            }
        }
コード例 #2
0
 public void Clear()
 {
     TrainingImages.Clear();
     MarkedTrainingImages.Clear();
     RecoginzingImages.Clear();
 }