コード例 #1
0
        public Bitmap Process(Bitmap input, ProgressBar progressBar)
        {
            var w         = new BinaryProcessor(input);
            var structure = new StructuringElement(StructuringElementShape.Rectangle, 3);

            w.Dilate(structure);

            return(w.GetBitmap());
        }
コード例 #2
0
        public Bitmap Process(Bitmap input, ProgressBar progressBar)
        {
            var p    = new ImageProcessor(input);
            var s1   = new StructuringElement(StructuringElementShape.Rectangle, 5);
            var s2   = new StructuringElement(StructuringElementShape.Rectangle, 9);
            var mask = new BinaryProcessor(_filter.Process(input, progressBar));

            mask.Close(s1);
            mask.Open(s1);
            p.Mask(mask);

            mask.Dilate(s2);


            var bt  = new BoundaryTrace(s1);
            var bmp = bt.Process(mask.GetBitmap(), progressBar);
            var p2  = new BinaryProcessor(bmp);

            //p.Layer(p2);

            return(p.GetBitmap());
        }