int FrameRows, FrameCols; // Rows and cols of current resolution
        //Image<Bgr, Byte> imgRblur;
        //Image<Gray, Byte> imgRcorner;

        //private VideoWriter vw = new VideoWriter("test.avi", 30, 800, 600, true);

        public FormWebCamEmgu()
        {
            InitializeComponent();
            vizRed      = new FormVisualizer(FormVisualizer.DisplayMode.Emgu, "Red");
            vizGreen    = new FormVisualizer(FormVisualizer.DisplayMode.Emgu, "Green");
            vizBlue     = new FormVisualizer(FormVisualizer.DisplayMode.Emgu, "Blue");
            vizFilters  = new FormVisualizer(FormVisualizer.DisplayMode.Emgu, "Filtered");
            vizOriginal = new FormVisualizer(FormVisualizer.DisplayMode.Emgu, "Original");
            vizYellow   = new FormVisualizer(FormVisualizer.DisplayMode.Emgu, "Yellow");
            ReadRegistryValues();
        }
Esempio n. 2
0
        private void middleColorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Bitmap bmp;

            if (zoomPicBox1.Image != null)
            {
                bmp = ImageProcessing.MiddleColor(zoomPicBox1.Image);
                FormVisualizer form2 = new FormVisualizer(FormVisualizer.DisplayMode.Form1, "");
                form2.SetPicture(bmp);
                form2.Show();
            }
        }
Esempio n. 3
0
        private void sobelToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Bitmap bmp = new Bitmap(zoomPicBox1.Image.Width, zoomPicBox1.Image.Height);

            if (zoomPicBox1.Image != null)
            {
                ImageProcessing.SobelPointers(ImageProcessing.Grayscale(zoomPicBox1.Image), bmp, zoomPicBox1.Image.Width, zoomPicBox1.Image.Height);
                FormVisualizer viewResult = new FormVisualizer(FormVisualizer.DisplayMode.Form1, "");
                viewResult.SetPicture(bmp);
                viewResult.Show();
            }
        }
Esempio n. 4
0
        private void cornerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Bitmap bmp;

            if (zoomPicBox1.Image != null)
            {
                long milliseconds1 = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
                bmp = ImageProcessing.FilterImage(zoomPicBox1.Image, Filters.Matrix3x3.Corner);
                long milliseconds2 = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
                MessageBox.Show((milliseconds2 - milliseconds1).ToString());
                FormVisualizer viewResult = new FormVisualizer(FormVisualizer.DisplayMode.Form1, "");
                viewResult.SetPicture(bmp);
                viewResult.Show();
            }
        }
        // Test method for single frame from file
        private void LoadFrame()
        {
            string            strFileName = ImageProcessing.OpenImageFile();
            FormVisualizer    visualizer  = new FormVisualizer(FormVisualizer.DisplayMode.Emgu, "Red");
            Image <Bgr, byte> image       = new Image <Bgr, byte>((Bitmap)Bitmap.FromFile(strFileName));

            strFileName = ImageProcessing.OpenImageFile();
            Image <Bgr, byte> imageOriginal = new Image <Bgr, byte>((Bitmap)Bitmap.FromFile(strFileName));

            List <WeightCenter> weights = FindSpots(image.Data, imageOriginal.Data, image.Rows, image.Cols, FilterColors.Red);

            //List<Point3D> detectedSpots = DetectFace(image.Data, weights, image.Rows, image.Cols, FilterColors.Red);
            //IdentifySide(imageOriginal.Data, detectedSpots[0], detectedSpots[1].ToArray(), detectedSpots[2].ToArray());

            //DrawPoints(imageOriginal.Data, detectedSpots, image.Rows, image.Cols);



            visualizer.Show();
            visualizer.SetPicture(imageOriginal);
        }