public FaceRecognitionDB() { try { faceRecognizer.Read(Application.StartupPath + @"/../../Images/eigenRecognizer.yml"); fisherRecognizer.Read(Application.StartupPath + @"/../../Images/fisherRecognizer.yml"); LBPHFaceRecognizer.Read(Application.StartupPath + @"/../../Images/lpbhRecognizer.yml"); } catch (Exception) { } }
public ImageService() { _fisherFaceRecognizer = new FisherFaceRecognizer(); //_fisherFaceRecognizer = new FisherFaceRecognizer(FaceRecognizerNumberOfComponents, FaceRecognizerThreshold); _lbphFaceRecognizer = new LBPHFaceRecognizer(); //_lbphFaceRecognizer = new LBPHFaceRecognizer(1, 8, 32, 32, 256); _cascadeClassifier = new CascadeClassifier(CascadeClassifierConfigPath); if (!Directory.Exists(DataFolder)) { Directory.CreateDirectory(DataFolder); } if (File.Exists(FisherTrainingDataPath)) { _fisherFaceRecognizer.Read(FisherTrainingDataPath); } if (File.Exists(LBPHTrainingDataPath)) { _lbphFaceRecognizer.Read(LBPHTrainingDataPath); } }