Accord.Tests.Imaging.RawMomentsTest.RawMomentsConstructorTest2 C# (CSharp) Method

RawMomentsConstructorTest2() private method

private RawMomentsConstructorTest2 ( ) : void
return void
        public void RawMomentsConstructorTest2()
        {
            var hu = Accord.Imaging.Image.Clone(Resources.hu);

            float[,] image;
            
            new ImageToMatrix()
            {
                Min = 0,
                Max = 255
            }.Convert(hu, out image);

            RawMoments target = new RawMoments(image, order: 3);

            Assert.AreEqual(86424.0 / target.M00, 1);
            Assert.AreEqual(1.177254E+7 / target.M01, 1, 1e-10);
            Assert.AreEqual(2.19032653E+9 / target.M02, 1, 1e-8);

            Assert.AreEqual(1.5264756E7 / target.M10, 1, 1e-10);
            Assert.AreEqual(2.08566813E9 / target.M11, 1, 1e-6);
            Assert.AreEqual(3.8643911413E11 / target.M12, 1, 1e-5);
            Assert.AreEqual(3.604560164E9 / target.M20, 1, 1e-3);
            Assert.AreEqual(4.9401212329E11 / target.M21, 1, 1e-3);

            Assert.AreEqual(9.451364E+11 / target.M30, 1, 1e-8);
            Assert.AreEqual(4.599169E+11 / target.M03, 1, 1e-8);
        }