예제 #1
0
파일: Form1.cs 프로젝트: hrewhwreh/CompGr
        private void closingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Filters filter1     = new Dilation(structElem());
            Filters filter2     = new Erosion(structElem());
            Bitmap  resultImage = filter1.processImage(Image, backgroundWorker1);

            resultImage       = filter2.processImage(resultImage, backgroundWorker1);
            pictureBox2.Image = resultImage;
            pictureBox2.Refresh();
            progressBar1.Value = 0;
        }
예제 #2
0
파일: Form1.cs 프로젝트: hrewhwreh/CompGr
        private void gradientToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Filters filter1      = new Dilation(structElem());
            Filters filter2      = new Erosion(structElem());
            Bitmap  resultImage1 = filter1.processImage(Image, backgroundWorker1);
            Bitmap  resultImage2 = filter2.processImage(Image, backgroundWorker1);
            Bitmap  resultImage  = new Bitmap(Image.Width, Image.Height);

            for (int i = 0; i < Image.Width; i++)
            {
                for (int j = 0; j < Image.Height; j++)
                {
                    resultImage.SetPixel(i, j, Color.FromArgb(resultImage1.GetPixel(i, j).R - resultImage2.GetPixel(i, j).R, resultImage1.GetPixel(i, j).G - resultImage2.GetPixel(i, j).G, resultImage1.GetPixel(i, j).B - resultImage2.GetPixel(i, j).B));
                }
            }
            pictureBox2.Image = resultImage;
            pictureBox2.Refresh();
            progressBar1.Value = 0;
        }
예제 #3
0
파일: Form1.cs 프로젝트: hrewhwreh/CompGr
        private void dilationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Filters filter = new Dilation(structElem());

            backgroundWorker1.RunWorkerAsync(filter);
        }