Exemplo n.º 1
0
            public static bool MeanRemoval(Bitmap bitmap, int nWeight)
            {
                ConvMatrix m = new ConvMatrix();

                m.SetAll(-1);
                m.Pixel  = nWeight;
                m.Factor = nWeight - 8;

                return(BitmapFilter.Conv3x3(bitmap, m));
            }
Exemplo n.º 2
0
            public static bool Smooth(Bitmap bitmap, int nWeight)
            {
                ConvMatrix m = new ConvMatrix();

                m.SetAll(1);
                m.Pixel  = nWeight;
                m.Factor = nWeight + 8;

                return(BitmapFilter.Conv3x3(bitmap, m));
            }
Exemplo n.º 3
0
            public static bool EmbossLaplacian(Bitmap bitmap)
            {
                ConvMatrix m = new ConvMatrix();

                m.SetAll(-1);
                m.TopMid = m.MidLeft = m.MidRight = m.BottomMid = 0;
                m.Pixel  = 4;
                m.Offset = 127;

                return(BitmapFilter.Conv3x3(bitmap, m));
            }
Exemplo n.º 4
0
            public static bool Sharpen(Bitmap bitmap, int nWeight)
            {
                ConvMatrix m = new ConvMatrix();

                m.SetAll(0);
                m.Pixel  = nWeight;
                m.TopMid = m.MidLeft = m.MidRight = m.BottomMid = -2;
                m.Factor = nWeight - 8;

                return(BitmapFilter.Conv3x3(bitmap, m));
            }
Exemplo n.º 5
0
            public static bool GaussianBlur(Bitmap bitmap, int nWeight)
            {
                ConvMatrix m = new ConvMatrix();

                m.SetAll(1);
                m.Pixel  = nWeight;
                m.TopMid = m.MidLeft = m.MidRight = m.BottomMid = 2;
                m.Factor = nWeight + 12;

                return(BitmapFilter.Conv3x3(bitmap, m));
            }
Exemplo n.º 6
0
            public static bool EdgeDetectQuick(Bitmap bitmap)
            {
                ConvMatrix m = new ConvMatrix();

                m.TopLeft    = m.TopMid = m.TopRight = -1;
                m.MidLeft    = m.Pixel = m.MidRight = 0;
                m.BottomLeft = m.BottomMid = m.BottomRight = 1;

                m.Offset = 127;

                return(BitmapFilter.Conv3x3(bitmap, m));
            }