Accord.Tests.Imaging.SauvolaTest.SauvolaTest2 C# (CSharp) 메소드

SauvolaTest2() 개인적인 메소드

private SauvolaTest2 ( ) : void
리턴 void
        public void SauvolaTest2()
        {
            double[,] diag = Matrix.Magic(5);

            Bitmap input;
            new MatrixToImage().Convert(diag, out input);

            // Create a new Variance filter
            SauvolaThreshold filter = new SauvolaThreshold();

            Assert.AreEqual(PixelFormat.Format8bppIndexed, input.PixelFormat);

            // Apply the filter
            Bitmap output = filter.Apply(input);

            double[,] actual;

            new ImageToMatrix().Convert(output, out actual);

            Assert.AreEqual(PixelFormat.Format8bppIndexed, output.PixelFormat);

            string str = actual.ToString(CSharpMatrixFormatProvider.InvariantCulture);

            double[,] expected = new double[,] 
            {
                { 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1 } 
            };

            Assert.IsTrue(expected.IsEqual(actual, 1e-6));
        }