Пример #1
0
        public void calculateGradientImage(Data.Image image)
        {
            if (swingSharpness == null)
            {
                swingSharpness = new double[image.width(), image.height()];

                /*  for (int x = 0; x < image.width(); x++)
                 *    for (int y = 0; y < image.height(); y++)
                 *        swingSharpness[x, y] = -255;*/
            }

            curentImage = image.image;
            curentImage = changeImage.translateToMonochrome(curentImage);
            matematical.setImage(curentImage);

            /*
             * for (int x = 0; x < image.width(); x++)
             *    for (int y = 0; y < image.height(); y++)
             *    {
             *        double gradient = matematical.gradientAtPoint(x, y);
             *        if (gradient > swingSharpness[x, y])
             *            swingSharpness[x, y] = gradient;
             *    }
             */
            if (step == 0)
            {
                step = (curentImage.Width * curentImage.Height) / 640000;
            }
            Parallel.For(0, 4, calculateGradientImage);
        }
Пример #2
0
 public void calculateGradientImage(Data.Image image)
 {
     if (width == 0)
     {
         width = image.width();
         hight = image.height();
     }
 }