public static double[][] AddRandom(double[][] picture, int percent)
        {
            int W      = picture[0].GetLength(0);
            int H      = picture.GetLength(0);
            LCG random = new LCG();

            for (int y = 0; y < H; y++)
            {
                for (int x = 0; x < W; x++)
                {
                    int rnd = random.Next(-100, 99);
                    if (rnd < 0)
                    {
                        rnd = -1;
                    }
                    if (rnd >= 0)
                    {
                        rnd = 1;
                    }
                    int possibility = random.Next(1, 100);
                    if (possibility <= percent)
                    {
                        picture[y][x] = picture[y][x] + rnd * 30;
                    }
                }
            }
            picture = ThresholdFun(picture, 0, 255);

            return(picture);
        }
        public static double[][] AddSP(double[][] picture, int percent)
        {
            int W      = picture[0].GetLength(0);
            int H      = picture.GetLength(0);
            LCG random = new LCG();

            for (int y = 0; y < H; y++)
            {
                for (int x = 0; x < W; x++)
                {
                    int possibility = random.Next(1, 100);
                    if (possibility <= percent)
                    {
                        int rnd = random.Next(0, 255);
                        if (rnd < 128)
                        {
                            picture[y][x] = 0;
                        }
                        if (rnd >= 128)
                        {
                            picture[y][x] = 255;
                        }
                    }
                }
            }
            picture = ThresholdFun(picture, 0, 255);
            return(picture);
        }