Ejemplo n.º 1
0
        public override Bitmap processImage(Bitmap sourceImage, BackgroundWorker worker)
        {
            DilationFilter    dilation    = new DilationFilter();
            ErosionFilter     erosion     = new ErosionFilter();
            SubtractionFilter subtraction = new SubtractionFilter(dilation.processImage(sourceImage, worker));

            return(subtraction.processImage(erosion.processImage(sourceImage, worker), worker));
        }
Ejemplo n.º 2
0
        private void dilationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            temp_image = new Bitmap(pictureBox1.Image);

            if (toolStripTextBox1.Text != "" && Convert.ToInt32(toolStripTextBox1.Text) > 0)
            {
                Filters filter = new DilationFilter(MatrixFilter.generateUnitMatrix(Convert.ToInt32(toolStripTextBox1.Text)));
                backgroundWorker1.RunWorkerAsync(filter);
            }
            else
            {
                Filters filter = new DilationFilter();
                backgroundWorker1.RunWorkerAsync(filter);
            }
        }
Ejemplo n.º 3
0
        public override Bitmap processImage(Bitmap sourceImage, BackgroundWorker worker)
        {
            DilationFilter dilation;
            ErosionFilter  erosion;

            if (kernel != null)
            {
                dilation = new DilationFilter(this.kernel);
                erosion  = new ErosionFilter(this.kernel);
            }
            else
            {
                dilation = new DilationFilter();
                erosion  = new ErosionFilter();
            }
            return(erosion.processImage(dilation.processImage(sourceImage, worker), worker));
        }