示例#1
0
        public static Bitmap MeanRemoval(Bitmap bitmap, int nWeight)
        {
            ConvolutionConfig config = ConvolutionConfig.GetFilledConfig(3, 3, 0, nWeight - 8, -1, PaddingType.Zero);

            config.SetMatrixValue(1, 1, nWeight);
            ConvolutionFilter filter = new ConvolutionFilter(config);

            return(filter.ApplyFilter(bitmap));
        }
示例#2
0
        public static Bitmap MeanRemovalThenSphere(Bitmap bitmap, MeanSphereConfig msConfig)
        {
            ConvolutionConfig config = ConvolutionConfig.GetFilledConfig(3, 3, 0, msConfig.nWeight - 8, -1, msConfig.paddingType);

            config.SetMatrixValue(1, 1, msConfig.nWeight);
            ConvolutionFilter filter = new ConvolutionFilter(config);
            Bitmap            newB   = filter.ApplyFilter(bitmap);

            newB = Sphere(newB, msConfig.sphereMidPoint);
            return(newB);
        }