예제 #1
0
        public void SamePhotoTest()
        {
            using (Image testImage = TestUtils.GetImage(TestUtils.TestPhoto1))
            {
                Tuple <ulong, byte[]> fingerPrint1 = FrameIndexer.IndexFrame(testImage);
                Tuple <ulong, byte[]> fingerPrint2 = FrameIndexer.IndexFrame(testImage);

                Assert.AreEqual(fingerPrint1.Item1, fingerPrint2.Item1);
                Assert.IsTrue(Enumerable.SequenceEqual(fingerPrint1.Item2, fingerPrint2.Item2));
            }
        }
예제 #2
0
        public void TotallyDifferentPhotosTest()
        {
            using (Image testImage1 = TestUtils.GetImage(TestUtils.TestPhoto1))
                using (Image testImage2 = TestUtils.GetImage(TestUtils.TestPhoto3))
                {
                    Tuple <ulong, byte[]> fingerPrint1 = FrameIndexer.IndexFrame(testImage1);
                    Tuple <ulong, byte[]> fingerPrint2 = FrameIndexer.IndexFrame(testImage2);
                    int distance = DistanceCalculator.CalculateHammingDistance(fingerPrint1.Item1, fingerPrint2.Item1);

                    Assert.AreEqual(10, distance);
                }
        }