Example #1
0
        public int[,] ApplySmooth(int[,] pixels, double weight = 2)
        {
            ConvolutionMatrix matrix = new ConvolutionMatrix(3);
            matrix.SetAll(1);
            matrix.Matrix[1, 1] = weight;
            matrix.Factor = weight + 8;

            FilterBase filter = new ConvolutionFilter() { Matrix = matrix };
            int[,] result = filter.Execute(pixels);

            return result;
        }
Example #2
0
        public int[,] Blur(int[,] pixels)
        {
            ConvolutionMatrix matrix = new ConvolutionMatrix(3);
            matrix.SetAll(2);
            matrix.Factor = 16;
            matrix.Offset = 0;

            matrix.Matrix[0, 0] = 1;
            matrix.Matrix[0, 2] = 1;
            matrix.Matrix[1, 1] = 4;
            matrix.Matrix[2, 0] = 1;
            matrix.Matrix[2, 2] = 1;

            return Filter(pixels, matrix);
        }