Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            PictureBox pb = new PictureBox();

            pb.SizeMode = PictureBoxSizeMode.Zoom;
            pb.Image    = LoG.MarrHildrethEdge(new Bitmap(Resources.no_photo));
            pb.Size     = new Size(245, 160);
            pb.Location = new Point(locX, locY);

            locX += 275;

            panel1.Controls.Add(pb);
        }
Ejemplo n.º 2
0
        private void MarrHildrethDetecting()
        {
            Bitmap afterGrey;

            var bmp = new Bitmap(uploadedImage);

            panel1.Invoke(new Action(() => AddImageOnPanel(new Bitmap(bmp), "Исходное изображение")));

            afterGrey = ImageProcessing.ImageToGrey(bmp);
            panel1.Invoke(new Action(() => AddImageOnPanel(new Bitmap(afterGrey), "Оттенки серого")));

            Bitmap afterGauss;

            if (checkBox2.Checked)
            {
                double sigma = 0;
                if (radioButton6.Checked)
                {
                    sigma = (double)numericUpDown4.Value;
                }
                afterGauss = Filters.GaussianFilter(afterGrey, sigma);
                panel1.Invoke(new Action(() => AddImageOnPanel(new Bitmap(afterGauss), "Фильтр Гаусса")));
            }
            else
            {
                afterGauss = afterGrey;
            }

            var afterMarrHildreth = LoG.MarrHildrethEdge(new Bitmap(afterGauss));

            panel1.Invoke(new Action(() => AddImageOnPanel(new Bitmap(afterMarrHildreth), "Метод Марр-Хилдрет")));

            Bitmap afterThreshold = ImageProcessing.FadeLaplassThreshold(afterMarrHildreth, trackBar2.Value);

            panel1.Invoke(new Action(() => AddImageOnPanel(new Bitmap(afterThreshold), "Пороговая фильтрация")));
        }