示例#1
0
        public void ApplySmooth(double weight)
        {
            ConvolutionMatrix matrix = new ConvolutionMatrix(3);

            matrix.SetAll(1);
            matrix.Matrix[1, 1] = weight;
            matrix.Factor       = weight + 8;
            bitmapImage         = Convolution3x3(bitmapImage, matrix);
        }
示例#2
0
        public void ApplyMeanRemoval(double weight)
        {
            ConvolutionMatrix matrix = new ConvolutionMatrix(3);

            matrix.SetAll(1);
            matrix.Matrix[0, 0] = -1;
            matrix.Matrix[1, 0] = -1;
            matrix.Matrix[2, 0] = -1;
            matrix.Matrix[0, 1] = -1;
            matrix.Matrix[1, 1] = weight;
            matrix.Matrix[2, 1] = -1;
            matrix.Matrix[0, 2] = -1;
            matrix.Matrix[1, 2] = -1;
            matrix.Matrix[2, 2] = -1;
            matrix.Factor       = weight - 8;
            bitmapImage         = Convolution3x3(bitmapImage, matrix);
        }
示例#3
0
        public void ApplyGaussianBlur(double peakValue)
        {
            ConvolutionMatrix matrix = new ConvolutionMatrix(3);

            matrix.SetAll(1);
            matrix.Matrix[0, 0] = peakValue / 4;
            matrix.Matrix[1, 0] = peakValue / 2;
            matrix.Matrix[2, 0] = peakValue / 4;
            matrix.Matrix[0, 1] = peakValue / 2;
            matrix.Matrix[1, 1] = peakValue;
            matrix.Matrix[2, 1] = peakValue / 2;
            matrix.Matrix[0, 2] = peakValue / 4;
            matrix.Matrix[1, 2] = peakValue / 2;
            matrix.Matrix[2, 2] = peakValue / 4;
            matrix.Factor       = peakValue * 4;
            bitmapImage         = Convolution3x3(bitmapImage, matrix);
        }
示例#4
0
        public void ApplyEmboss(double weight)
        {
            ConvolutionMatrix matrix = new ConvolutionMatrix(3);

            matrix.SetAll(1);
            matrix.Matrix[0, 0] = -1;
            matrix.Matrix[1, 0] = 0;
            matrix.Matrix[2, 0] = -1;
            matrix.Matrix[0, 1] = 0;
            matrix.Matrix[1, 1] = weight;
            matrix.Matrix[2, 1] = 0;
            matrix.Matrix[0, 2] = -1;
            matrix.Matrix[1, 2] = 0;
            matrix.Matrix[2, 2] = -1;
            matrix.Factor       = 4;
            matrix.Offset       = 127;
            bitmapImage         = Convolution3x3(bitmapImage, matrix);
        }
示例#5
0
 public void ApplySmooth(double weight)
 {
     ConvolutionMatrix matrix = new ConvolutionMatrix(3);
     matrix.SetAll(1);
     matrix.Matrix[1, 1] = weight;
     matrix.Factor = weight + 8;
     bitmapImage = Convolution3x3(bitmapImage, matrix);
 }
示例#6
0
 public void ApplySharpen(double weight)
 {
     ConvolutionMatrix matrix = new ConvolutionMatrix(3);
     matrix.SetAll(1);
     matrix.Matrix[0, 0] = 0;
     matrix.Matrix[1, 0] = -2;
     matrix.Matrix[2, 0] = 0;
     matrix.Matrix[0, 1] = -2;
     matrix.Matrix[1, 1] = weight;
     matrix.Matrix[2, 1] = -2;
     matrix.Matrix[0, 2] = 0;
     matrix.Matrix[1, 2] = -2;
     matrix.Matrix[2, 2] = 0;
     matrix.Factor = weight - 8;
     bitmapImage = Convolution3x3(bitmapImage, matrix);
 }
示例#7
0
 public void ApplyGaussianBlur(double peakValue)
 {
     ConvolutionMatrix matrix = new ConvolutionMatrix(3);
     matrix.SetAll(1);
     matrix.Matrix[0, 0] = peakValue / 4;
     matrix.Matrix[1, 0] = peakValue / 2;
     matrix.Matrix[2, 0] = peakValue / 4;
     matrix.Matrix[0, 1] = peakValue / 2;
     matrix.Matrix[1, 1] = peakValue;
     matrix.Matrix[2, 1] = peakValue / 2;
     matrix.Matrix[0, 2] = peakValue / 4;
     matrix.Matrix[1, 2] = peakValue / 2;
     matrix.Matrix[2, 2] = peakValue / 4;
     matrix.Factor = peakValue * 4;
     bitmapImage = Convolution3x3(bitmapImage, matrix);
 }
示例#8
0
 public void ApplyEmboss(double weight)
 {
     ConvolutionMatrix matrix = new ConvolutionMatrix(3);
     matrix.SetAll(1);
     matrix.Matrix[0, 0] = -1;
     matrix.Matrix[1, 0] = 0;
     matrix.Matrix[2, 0] = -1;
     matrix.Matrix[0, 1] = 0;
     matrix.Matrix[1, 1] = weight;
     matrix.Matrix[2, 1] = 0;
     matrix.Matrix[0, 2] = -1;
     matrix.Matrix[1, 2] = 0;
     matrix.Matrix[2, 2] = -1;
     matrix.Factor = 4;
     matrix.Offset = 127;
     bitmapImage = Convolution3x3(bitmapImage, matrix);
 }