public void gradientAtPoint9_IntPoint_Test()              //Проверка градиента  внутренней точки
        {
            //arrange
            IParser parser = new Parser();
            Bitmap  img    = parser.readPNG("Data\\sample_10.png");

            MathematicialSearchPoint core = new MathematicialSearchPoint9();

            core.setImage(img);

            double[,] X = new double[7, 7];
            for (int i = 599; i < 606; i++)
            {
                for (int j = 599; j < 606; j++)
                {
                    X[i - 599, j - 599] = img.GetPixel(i, j).B;   //Матрица окружения точки (602,602)
                }
            }
            double gradX = 0;
            double gradY = 0;
            for (int i = 0; i < 7; i++)
            {
                for (int j = 0; j < 7; j++)
                {
                    gradX += X[i, j] * core.XMatrix[j, i];
                    gradY += X[i, j] * core.YMatrix[j, i];
                }
            }
            //act
            double exepected = (gradX + gradY) / 2;
            double actual    = core.gradientAtPoint(602, 602);
            //assert
            Assert.AreEqual(exepected, actual);
        }
        public void gradientAtPoint9_CornerPoint_Test()              //Проверка градиента  угловой точки
        {
            //arrange
            IParser parser = new Parser();
            Bitmap  img    = parser.readPNG("Data\\sample_10.png");

            //Blue[i, j] = 0.3 * img.GetPixel(i, j).R + 0.59 * img.GetPixel(i, j).G + 0.11 * img.GetPixel(i, j).B;    //Заполнение монохромного изображения

            MathematicialSearchPoint core = new MathematicialSearchPoint9();

            core.setImage(img);
            double[,] X = new double[7, 7];
            for (int i = 0; i < 7; i++)
            {
                for (int j = 0; j < 7; j++)
                {
                    X[i, j] = 0;
                }
            }
            for (int i = 3; i < 7; i++)
            {
                for (int j = 3; j < 7; j++)
                {
                    X[i, j] = img.GetPixel(i - 3, j - 3).B;               //Матрица окружения точки (0,0)
                }
            }
            double gradX = 0;
            double gradY = 0;
            for (int i = 0; i < 7; i++)
            {
                for (int j = 0; j < 7; j++)
                {
                    gradX += X[i, j] * core.XMatrix[j, i];
                    gradY += X[i, j] * core.YMatrix[j, i];
                }
            }
            //act
            double exepected = (gradX + gradY) / 2;
            double actual    = core.gradientAtPoint(0, 0);
            //assert
            Assert.AreEqual(exepected, actual);
        }
        public void gradientAtPoint9_BoundaryPoint_Test()              //Проверка градиента  граничной точки
        {
            //arrange
            IParser parser = new Parser();
            Bitmap  img    = parser.readPNG("Data\\sample_10.png");; //Заполнение монохромного изображения

            MathematicialSearchPoint core = new MathematicialSearchPoint9();

            core.setImage(img);

            double[,] X = new double[7, 7];
            for (int i = 0; i < 7; i++)
            {
                for (int j = 0; j < 7; j++)
                {
                    X[i, j] = 0;
                }
            }
            for (int i = 796; i < 800; i++)
            {
                for (int j = 0; j < 7; j++)
                {
                    X[i - 796, j] = img.GetPixel(i, j).B;             //Матрица окружения точки (799,3)
                }
            }
            double gradX = 0;
            double gradY = 0;
            for (int i = 0; i < 7; i++)
            {
                for (int j = 0; j < 7; j++)
                {
                    gradX += X[i, j] * core.XMatrix[j, i];
                    gradY += X[i, j] * core.YMatrix[j, i];
                }
            }
            //act
            double exepected = (gradX + gradY) / 2;
            double actual    = core.gradientAtPoint(799, 3);
            //assert
            Assert.AreEqual(exepected, actual);
        }