public void CorrectFaceTest1() { Recognizer _testReco; FaceImage _testImage; LabelStorageMock _labelRepo = new LabelStorageMock(4); ImageStorageMock _imageRepo = new ImageStorageMock(); _testReco = new Recognizer(_imageRepo, _labelRepo); Bitmap load_img = new Bitmap(Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.Parent.FullName + @"\Recognizer\TestSample\TestPerson1\e2105db7-8e4f-4cbe-b1d0-7b0c7274431c.bmp"); _testImage = new FaceImage(load_img, _imageRepo.RepoPath + @"\DTO\haarcascade_frontalface_default.xml") { Id = new Identifier(0) }; // face detection there IIdentifier actual = _testReco.GetIdentity(_testImage); var expected = new Identifier(0); Assert.AreEqual(expected, actual); }
public void CorrectFaceTest4() { FaceImage _testImage; LabelStorageMock _labelRepo; ImageStorageMock _imageRepo; Recognizer _testReco; _labelRepo = new LabelStorageMock(4); _imageRepo = new ImageStorageMock(); _testReco = new Recognizer(_imageRepo, _labelRepo); Bitmap load_img = new Bitmap(Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.Parent.FullName + @"\Recognizer\TestSample\TestPerson4\28e24e03-20cf-4c1b-bf7d-5d82d67d15f7.bmp"); _testImage = new FaceImage(load_img, _imageRepo.RepoPath + @"\DTO\haarcascade_frontalface_default.xml") { Id = new Identifier(3) }; // face detection there IIdentifier actual = _testReco.GetIdentity(_testImage); var expected = new Identifier(3); Assert.AreEqual(expected, actual); }
public void CorrectFaceTest3() { FaceImage _testImage; LabelStorageMock _labelRepo; ImageStorageMock _imageRepo; Recognizer _testReco; _labelRepo = new LabelStorageMock(4); _imageRepo = new ImageStorageMock(); _testReco = new Recognizer(_imageRepo, _labelRepo); Bitmap load_img = new Bitmap(Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.Parent.FullName + @"\Recognizer\TestSample\TestPerson3\bc23325e-a23c-45ac-b970-e26726eca09c.bmp"); _testImage = new FaceImage(load_img, _imageRepo.RepoPath + @"\DTO\haarcascade_frontalface_default.xml") { Id = new Identifier(2) }; // face detection there IIdentifier actual = _testReco.GetIdentity(_testImage); var expected = new Identifier(2); Assert.AreEqual(expected, actual); }
public void CorrectFaceTest2() { FaceImage _testImage; LabelStorageMock _labelRepo; ImageStorageMock _imageRepo; Recognizer _testReco; _labelRepo = new LabelStorageMock(4); _imageRepo = new ImageStorageMock(); _testReco = new Recognizer(_imageRepo, _labelRepo); Bitmap load_img = new Bitmap(Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.Parent.FullName + @"\Recognizer\TestSample\TestPerson2\ea055021-3316-4a9f-bef4-1b5cebb428ad.bmp"); _testImage = new FaceImage(load_img, _imageRepo.RepoPath + @"\DTO\haarcascade_frontalface_default.xml") { Id = new Identifier(1) }; // face detection there IIdentifier actual = _testReco.GetIdentity(_testImage); var expected = new Identifier(1); Assert.AreEqual(expected, actual); }