Example #1
0
        public override Bitmap proccessImage(Bitmap sourceImage, BackgroundWorker worker)
        {
            Erosion  er  = new Erosion(structureElement, threshold);
            Dilation dil = new Dilation(structureElement, threshold);
            Bitmap   img = er.proccessImage(sourceImage, worker);

            return(dil.proccessImage(img, worker));
        }
Example #2
0
        public Bitmap ProcessImage(Bitmap sourceImage)
        {
            Dilation    dilation    = new Dilation();
            Erosion     erosion     = new Erosion();
            HelperClass subtraction = new HelperClass(dilation.processImage(sourceImage));

            return(subtraction.processImage(erosion.processImage(sourceImage)));
        }
Example #3
0
        private void сужениеToolStripMenuItem_Click(object sender, EventArgs e)
        {
            bool[,] structureElement = new bool[3, 3] {
                { true, true, true }, { true, true, true }, { true, true, true }
            };
            Filters filter = new Erosion(structureElement, 0.6f);

            backgroundWorker1.RunWorkerAsync(filter);
        }
Example #4
0
        public override Bitmap processImage(Bitmap sourceImage, BackgroundWorker worker)
        {
            Bitmap  resultImage = new Bitmap(sourceImage.Width, sourceImage.Height);
            Filters filter      = new Erosion();

            sourceImage = filter.processImage(sourceImage, worker);

            return(base.processImage(sourceImage, worker));
        }
Example #5
0
        public Bitmap ProcessImage(Bitmap sourceImage)
        {
            Dilation dilation;
            Erosion  erosion;

            if (kernel != null)
            {
                dilation = new Dilation(this.kernel);
                erosion  = new Erosion(this.kernel);
            }
            else
            {
                dilation = new Dilation();
                erosion  = new Erosion();
            }
            return(erosion.processImage(dilation.processImage(sourceImage)));
        }
Example #6
0
        public override Bitmap proccessImage(Bitmap sourceImage, BackgroundWorker worker)
        {
            Erosion  er     = new Erosion(structureElement, threshold);
            Dilation dil    = new Dilation(structureElement, threshold);
            Bitmap   img1   = er.proccessImage(sourceImage, worker);
            Bitmap   img2   = dil.proccessImage(sourceImage, worker);
            Bitmap   result = new Bitmap(sourceImage.Width, sourceImage.Height);

            for (int i = 0; i < sourceImage.Width; ++i)
            {
                for (int j = 0; j < sourceImage.Height; ++j)
                {
                    Color c1 = img1.GetPixel(i, j);
                    Color c2 = img2.GetPixel(i, j);
                    Color c  = Color.FromArgb(Clamp(c1.R - c2.R, 0, 255), Clamp(c1.G - c2.G, 0, 255), Clamp(c1.B - c2.B, 0, 255));
                    result.SetPixel(i, j, c);
                }
            }
            return(result);
        }
Example #7
0
        private void erosionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Filters filter = new Erosion();

            backgroundWorker1.RunWorkerAsync(filter);
        }