Beispiel #1
0
        public static ConvolutionMatrix MeanRemoval(int weight = 9)
        {
            ConvolutionMatrix cm     = new ConvolutionMatrix();
            double            factor = weight - 8;

            cm.SetAll(-1 / factor);
            cm[1, 1] = weight / factor;
            return(cm);
        }
Beispiel #2
0
        public static ConvolutionMatrix Smooth(int weight = 1)
        {
            ConvolutionMatrix cm     = new ConvolutionMatrix();
            double            factor = weight + 8;

            cm.SetAll(1 / factor);
            cm[1, 1] = weight / factor;
            return(cm);
        }
        public static ConvolutionMatrix MeanRemoval(int weight = 9)
        {
            ConvolutionMatrix cm = new ConvolutionMatrix();

            cm.SetAll(-1);
            cm.Matrix[1, 1] = weight;
            cm.Factor       = weight - 8;
            return(cm);
        }
        public static ConvolutionMatrix Smooth(int weight = 1)
        {
            ConvolutionMatrix cm = new ConvolutionMatrix();

            cm.SetAll(1);
            cm.Matrix[1, 1] = weight;
            cm.Factor       = weight + 8;
            return(cm);
        }
Beispiel #5
0
        public static ConvolutionMatrix Emboss()
        {
            ConvolutionMatrix cm = new ConvolutionMatrix();

            cm.SetAll(-1);
            cm[1, 1]  = 4;
            cm[1, 0]  = cm[0, 1] = cm[2, 1] = cm[1, 2] = 0;
            cm.Offset = 127;
            return(cm);
        }
Beispiel #6
0
        public static ConvolutionMatrix Sharpen(int weight = 11)
        {
            ConvolutionMatrix cm     = new ConvolutionMatrix();
            double            factor = weight - 8;

            cm.SetAll(0);
            cm[1, 1] = weight / factor;
            cm[1, 0] = cm[0, 1] = cm[2, 1] = cm[1, 2] = -2 / factor;
            return(cm);
        }
        public static ConvolutionMatrix Sharpen(int weight = 11)
        {
            ConvolutionMatrix cm = new ConvolutionMatrix();

            cm.SetAll(0);
            cm.Matrix[1, 1] = weight;
            cm.Matrix[1, 0] = cm.Matrix[0, 1] = cm.Matrix[2, 1] = cm.Matrix[1, 2] = -2;
            cm.Factor       = weight - 8;
            return(cm);
        }
        public static ConvolutionMatrix GaussianBlur(int weight = 4)
        {
            ConvolutionMatrix cm = new ConvolutionMatrix();

            cm.SetAll(1);
            cm.Matrix[1, 1] = weight;
            cm.Matrix[1, 0] = cm.Matrix[0, 1] = cm.Matrix[2, 1] = cm.Matrix[1, 2] = 2;
            cm.Factor       = weight + 12;
            return(cm);
        }
 public static ConvolutionMatrix Smooth(int weight = 1)
 {
     ConvolutionMatrix cm = new ConvolutionMatrix();
     cm.SetAll(1);
     cm.Matrix[1, 1] = weight;
     cm.Factor = weight + 8;
     return cm;
 }
 public static ConvolutionMatrix Sharpen(int weight = 11)
 {
     ConvolutionMatrix cm = new ConvolutionMatrix();
     cm.SetAll(0);
     cm.Matrix[1, 1] = weight;
     cm.Matrix[1, 0] = cm.Matrix[0, 1] = cm.Matrix[2, 1] = cm.Matrix[1, 2] = -2;
     cm.Factor = weight - 8;
     return cm;
 }
 public static ConvolutionMatrix MeanRemoval(int weight = 9)
 {
     ConvolutionMatrix cm = new ConvolutionMatrix();
     cm.SetAll(-1);
     cm.Matrix[1, 1] = weight;
     cm.Factor = weight - 8;
     return cm;
 }
 public static ConvolutionMatrix GaussianBlur(int weight = 4)
 {
     ConvolutionMatrix cm = new ConvolutionMatrix();
     cm.SetAll(1);
     cm.Matrix[1, 1] = weight;
     cm.Matrix[1, 0] = cm.Matrix[0, 1] = cm.Matrix[2, 1] = cm.Matrix[1, 2] = 2;
     cm.Factor = weight + 12;
     return cm;
 }
 public static ConvolutionMatrix Emboss()
 {
     ConvolutionMatrix cm = new ConvolutionMatrix();
     cm.SetAll(-1);
     cm.Matrix[1, 1] = 4;
     cm.Matrix[1, 0] = cm.Matrix[0, 1] = cm.Matrix[2, 1] = cm.Matrix[1, 2] = 0;
     cm.Offset = 127;
     return cm;
 }