Accord.Tests.Imaging.HuMomentsTest.ComputeTest2 C# (CSharp) Method

ComputeTest2() private method

private ComputeTest2 ( ) : void
return void
        public void ComputeTest2()
        {
            float[,] img1; new ImageToMatrix().Convert(Accord.Imaging.Image.Clone(Resources.tt1), out img1);
            float[,] img2; new ImageToMatrix().Convert(Accord.Imaging.Image.Clone(Resources.tt2), out img2);
            float[,] img3; new ImageToMatrix().Convert(Accord.Imaging.Image.Clone(Resources.tt3), out img3);
            float[,] img4; new ImageToMatrix().Convert(Accord.Imaging.Image.Clone(Resources.tt4), out img4);

            var hu1 = new HuMoments(img1);
            var hu2 = new HuMoments(img2);
            var hu3 = new HuMoments(img3);
            var hu4 = new HuMoments(img4);

            Assert.AreEqual(hu1.I1, hu2.I1, 0.015);
            Assert.AreEqual(hu1.I2, hu2.I2, 0.015);
            Assert.AreEqual(hu1.I3, hu2.I3, 1e-5);
            Assert.AreEqual(hu1.I4, hu2.I4, 1e-4);
            Assert.AreEqual(hu1.I5, hu2.I5, 1e-5);
            Assert.AreEqual(hu1.I6, hu2.I6, 1e-5);

            Assert.AreEqual(hu3.I1, hu4.I1, 1e-3);
            Assert.AreEqual(hu3.I2, hu4.I2, 1e-4);
            Assert.AreEqual(hu3.I3, hu4.I3, 1e-5);
            Assert.AreEqual(hu3.I4, hu4.I4, 1e-4);
            Assert.AreEqual(hu3.I5, hu4.I5, 1e-5);
            Assert.AreEqual(hu3.I6, hu4.I6, 1e-5);
        }
    }