public int[,] Filter(int[,] pixels, ConvolutionMatrix matrix) { FilterBase filter = new ConvolutionFilter() { Matrix = matrix }; int[,] result = filter.Execute(pixels); return result; }
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; }