• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Video.NewFrameEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中AForge.Video.NewFrameEventArgs的典型用法代码示例。如果您正苦于以下问题:C# NewFrameEventArgs类的具体用法?C# NewFrameEventArgs怎么用?C# NewFrameEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NewFrameEventArgs类属于AForge.Video命名空间,在下文中一共展示了NewFrameEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: videoSource_NewFrame

            void videoSource_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            lock (s)
            { this.pictureBox1.Image = (Image)eventArgs.Frame.Clone(); }

            
        }
开发者ID:DogiDepytat,项目名称:Git,代码行数:7,代码来源:Form1.cs


示例2: controller_NewFrame

        void controller_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            if (!backproj)
            {
                Bitmap image = eventArgs.Frame;

                if (image == null)
                    return;

                if (parent.faceForm != null && !parent.faceForm.IsDisposed)
                {
                    MatchingTracker matching = parent.faceForm.faceController.Tracker as MatchingTracker;

                    Rectangle rect = new Rectangle(
                        matching.TrackingObject.Center.X,
                        0,
                        image.Width - matching.TrackingObject.Center.X,
                        matching.TrackingObject.Center.Y);

                 
                    rect.Intersect(new Rectangle(0, 0, image.Width, image.Height));

                     marker.Rectangles = new[] { matching.TrackingObject.Rectangle };
                     image = marker.Apply(image);
                }


                pictureBox.Image = image;
            }
        }
开发者ID:BiYiTuan,项目名称:framework,代码行数:30,代码来源:VisionForm.cs


示例3: FinalVideo_NewFrame

 void FinalVideo_NewFrame(object sender, NewFrameEventArgs eventArgs)
 {
     Icon newIcon = new Icon(@"c:\users\gregster\documents\visual studio 2012\Projects\WebCamTrack\WebCamTrack\bin\Debug\favicon.ico");
     BlobCounter bc = new BlobCounter();
     EuclideanColorFiltering filter = new EuclideanColorFiltering();
     Bitmap video = (Bitmap)eventArgs.Frame.Clone();//sem filtro
     Bitmap video1 = (Bitmap)eventArgs.Frame.Clone();// imagem com filtro
     //
     filter.CenterColor = new RGB(0, 0, 0);
     filter.Radius = 100;
     filter.ApplyInPlace(video1);//aplicando o filtro
     bc.MinWidth = 5;
     bc.MinHeight = 5;
     bc.FilterBlobs = true;
     //  bc.ObjectsOrder = ObjectsOrder.Size;
     bc.ProcessImage(video1);// processando a imagem que ja foi filtrada para identificar objetos
     Rectangle[] rects = bc.GetObjectsRectangles();
     foreach (Rectangle recs in rects)
         if (rects.Length > 0)
         {
             Rectangle objectRect = rects[0];
             Graphics g = Graphics.FromImage(video);//identificar objetos a partir da imagem com filtro
             Graphics h = Graphics.FromImage(video1);
             using (Pen pen = new Pen(Color.FromArgb(160, 255, 160), 5))
             {
                 g.DrawIcon(newIcon, objectRect);
                // g.DrawRectangle(pen, objectRect);
                 h.DrawRectangle(pen, objectRect);
             }
             g.Dispose();
             h.Dispose();
         }
     pictureBox1.Image = video;
     pictureBox2.Image = video1;
 }
开发者ID:GustavoGregorio,项目名称:Projetos-pessoais,代码行数:35,代码来源:Form1.cs


示例4: video_NewFrame

        private void video_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            // get new frame

            pictureBox1.Image = (Bitmap)eventArgs.Frame.Clone();
            // process the frame
        }
开发者ID:kill4n,项目名称:Kuro_ACM,代码行数:7,代码来源:Form1.cs


示例5: cam_NewFram

        private void cam_NewFram(object sender, NewFrameEventArgs eventArgs)
        {
            Bitmap bit = (Bitmap)eventArgs.Frame.Clone();
            pictureBoxPic.Image = bit;

            //throw new NotImplementedException();
        }
开发者ID:tazimhoque,项目名称:Virtual-Examiner,代码行数:7,代码来源:Webcam.cs


示例6: cam_NewFrame

        void cam_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            //pictureBox1.Image = (Bitmap)eventArgs.Frame.Clone();
            Bitmap sourceImage = (Bitmap)eventArgs.Frame.Clone();
            pictureBox1.Image = ApplyRGBFilter(sourceImage);    //Applying filter and show in picture box

        }
开发者ID:kgarris2,项目名称:HackRPI2015,代码行数:7,代码来源:Form1.cs


示例7: _videoCaptureDevice_NewFrame

 private void _videoCaptureDevice_NewFrame(object sender, NewFrameEventArgs eventArgs)
 {
     Bitmap bitmap = (Bitmap)eventArgs.Frame.Clone();
     CameraFrameEventArgs args = new CameraFrameEventArgs(bitmap);
     OnCameraFrame(args);
     bitmap.Dispose();
 }
开发者ID:ShlomyShivek,项目名称:HomeSecure,代码行数:7,代码来源:LocalCameraDevice.cs


示例8: videoNewFrame

        private void videoNewFrame(object sender, NewFrameEventArgs args)
        {

            Bitmap temp = args.Frame.Clone() as Bitmap;

            try
            {
                frameCounter++;

                if (frameCounter > 10)
                {
                    cards = recognizer.Recognize(temp);
                    frameCounter = 0;
                }

                //Draw Rectangle around cards and write card strings on card
                using (Graphics graph = Graphics.FromImage(temp))
                {
                    foreach (Card card in cards)
                    {
                        graph.DrawPolygon(pen, card.Corners); //Draw a polygon around card
                        PointF point = CardRecognizer.GetStringPoint(card.Corners); //Find Top left corner
                        point.Y += 10;
                        graph.DrawString(card.ToString(), font, Brushes.White, point); //Write string on card
                    }
                }
            }
            catch { }
            this.pictureBox1.Image = ResizeBitmap(temp);
        }
开发者ID:Andrey-Pavlov,项目名称:BlackJack-Card-Recognition,代码行数:30,代码来源:Form1.cs


示例9: Video_NewFrame

        //eventhandler if new frame is ready
        private void Video_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            cameraImage = (Bitmap)eventArgs.Frame.Clone();
            //do processing here
            

        }
开发者ID:Karmagrinder,项目名称:ClosedEyeVisuals,代码行数:8,代码来源:VideoSourceHandler.cs


示例10: cam_NewFrame

        void cam_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            video1 = (Bitmap)eventArgs.Frame.Clone();
             video2 = (Bitmap)eventArgs.Frame.Clone();
             bool isChecked = radioButton1.Checked;
             if (isChecked)
             {

                 trackBar3.Enabled = true;
                 trackBar4.Enabled = true;
                 trackBar5.Enabled = true;
                 trackBar6.Enabled = true;
                 trackBar7.Enabled = true;
                 trackBar8.Enabled = true;
                 Rgb_obj.ApplyRGB(video2, minR, maxR, minG, maxG, minB, maxB); // Apply Rgb Filter
             }
             else
             {
                 FACE_DECTECTION.Face_Detection(video2); // Apply Face detection filter
             }

            grayScale_Image = gray_obj.Apply_grayscale(video2); // Apply GrayScale Filter
            Blob_Detection.blob_setter(video1 ,grayScale_Image, 10, 10);

            pictureBox1.Image = video2;
            pictureBox2.Image = video1;
        }
开发者ID:Rohail1,项目名称:OOP-Project,代码行数:27,代码来源:Form1.cs


示例11: OnNewFrame

 //------------------------------------------------------------------------------------------------------------------------
 private void OnNewFrame(object sender, NewFrameEventArgs eventArgs)
 {
     // get new frame
     Bitmap bitmap = eventArgs.Frame;
     if (IsActive)
         OnFrameCaptured(this, new VideoEventArgs(bitmap));
 }
开发者ID:yodiwo,项目名称:plegma,代码行数:8,代码来源:WebCamFrameTrapper.cs


示例12: cam_NewFrame

        void cam_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            //Evento em que mostra o frame no picture box
            Bitmap bit = (Bitmap)eventArgs.Frame.Clone();
            pbCamera.Image = bit;

        } 
开发者ID:GeoOjacob,项目名称:sppdi,代码行数:7,代码来源:WebcamWindow.xaml.cs


示例13: captureDevice_NewFrame

        void captureDevice_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            using (UnmanagedImage uimage = UnmanagedImage.FromManagedImage(eventArgs.Frame))
            {
                try
                {
                    using (Bitmap image = uimage.ToManagedImage())
                    {
                        IntPtr hBitMap = image.GetHbitmap();
                        try
                        {
                            BitmapSource bmaps = Imaging.CreateBitmapSourceFromHBitmap(hBitMap, IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
                            bmaps.Freeze();
                            Dispatcher.Invoke((Action)(() =>
                            {
                                pictureBoxMain.Source = bmaps;
                            }), DispatcherPriority.Render, null);

                            process.NewBitmap(image);
                        }
                        finally
                        {
                            DeleteObject(hBitMap);
                        }
                    }
                }
                catch (Exception ex)
                {
                    ex.ToString();
                }
            }
        }
开发者ID:GeorgianCostea,项目名称:Xanders-Work,代码行数:32,代码来源:MainWindow.xaml.cs


示例14: video_NewFrame

        private void video_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            // get new frame
            Bitmap bitmap = eventArgs.Frame;

            Bitmap imediateDraw = new Bitmap(bitmap, new Size(pictureBox2.Width, pictureBox2.Height));

            pictureBox2.Invoke((Action)delegate()
            {
                if (pictureBox2.Image != null)
                {
                    pictureBox2.Image.Dispose();
                }

                pictureBox2.Image = imediateDraw;
            });

            Bitmap clone = new Bitmap(bitmap.Width, bitmap.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
            using (Graphics gr = Graphics.FromImage(clone))
            {
                gr.DrawImage(bitmap, new Point(0, 0));
            }

            processor.Image = clone;

            bitmap.Dispose();
        }
开发者ID:alexghitulescu,项目名称:glyph-detector,代码行数:27,代码来源:Form1.cs


示例15: camNewFrame

 private void camNewFrame(object sender, NewFrameEventArgs args)
 {
     lock (imgLock)
     {
         currentFrame = (Bitmap)args.Frame.Clone();
         imageAvailable = true;
     }
 }
开发者ID:sic2,项目名称:HaptiQ,代码行数:8,代码来源:CameraGlyphsInput.cs


示例16: NewFrameHandler

        private void NewFrameHandler(object sender, NewFrameEventArgs eventArgs)
        {
            Bitmap bitmap = (Bitmap)eventArgs.Frame.Clone();
            FastBitmap sobelBitmap = new FastBitmap(bitmap);
            FastBitmap fastBitmap = new FastBitmap(bitmap);
            Harries dummy = new Harries();
            byte[] gray = fastBitmap.GrayPixels;
            var ps = dummy.Corner(gray, fastBitmap.Width, fastBitmap.Height);
            int r = 1;
            var size = new Size(r, r);
            foreach(Point p in ps)
            {
                using (Graphics g = Graphics.FromImage(bitmap))
                {
                    g.DrawRectangle(Pens.Coral, new System.Drawing.Rectangle(p, size));
                }
            }

            //for (int i = 0; i < filters.Length; i++)
            //{
            //    filters[0].DoFilter(fastBitmap);
            //}
            //Parallel.For(0, fastBitmap.Width, i =>
            // {
            //     for (int j = 0; j < fastBitmap.Height; j++)
            //     {
            //         int difference = notModifiedBitmap[i, j] - fastBitmap[i, j];
            //         fastBitmap[i, j] = difference > 0 ? (byte)difference : (byte)0;
            //     }
            // });
            List<System.Drawing.Rectangle> result = detector.getElements(fastBitmap, 1, 1.25f, 0.1f, 2, defaultRect);
            foreach(System.Drawing.Rectangle rect in result)
            {
                System.Drawing.Rectangle nRect = rect;
                nRect.Height /= 2;
                List<System.Drawing.Rectangle> eyeResult = eyeDetector.getElements(fastBitmap, 1, 1.25f, 0.1f, 1, nRect);
                using (Graphics g = Graphics.FromImage(bitmap))
                {
                    if (eyeResult.Count > 1)
                    {
                        filters[1].DoFilter(sobelBitmap);
                        SobelDetektor det = (SobelDetektor)filters[1];
                        g.DrawRectangles(Pens.Blue, eyeResult.ToArray());
                        foreach ( var eye in eyeResult)
                        {
                            System.Drawing.Rectangle pupil = searcher.FindPupil(sobelBitmap, eye, det.Angulars);
                            g.DrawEllipse(Pens.Red, pupil);
                        }
                    }
                }
            };
            using (Graphics g = Graphics.FromImage(bitmap))
            {
                if (result.Count > 0) g.DrawRectangles(Pens.GreenYellow, result.ToArray());
            }
            pictureBox1.Image = bitmap;
        }
开发者ID:Lena-P,项目名称:face-recognizer,代码行数:57,代码来源:Form1.cs


示例17: _device_NewFrame

        void _device_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            Bitmap bmp = eventArgs.Frame;

            FoundColorSpaces colorSpaces = ColorSpaceFinder.Find(bmp);
            FoundBlobs foundBlobs = BlobFinder.Find(colorSpaces, 80, 25, 90, 50, 1.2, 2.2);
            
            foreach(Blob blob in foundBlobs.Blobs)
            {
                Bitmap correctedBlobBitmap = ColorSpaceFinder.FindColorCorrectedForBlob(colorSpaces, blob);
                ColorTypeEnum color = ColorSpaceFinder.FindShapeColor(correctedBlobBitmap,
                    _red, _green, _purple); 

                System.Drawing.Pen pen = null; 
                switch(color)
                {
                    case ColorTypeEnum.Green:
                        pen = new System.Drawing.Pen(System.Drawing.Brushes.Green, 5); 
                        break; 
                    case ColorTypeEnum.Red:
                        pen = new System.Drawing.Pen(System.Drawing.Brushes.Red, 5); 
                        break; 
                    case ColorTypeEnum.Purple:
                        pen = new System.Drawing.Pen(System.Drawing.Brushes.Purple, 5); 
                        break; 
                    case ColorTypeEnum.Unknown:
                        pen = new System.Drawing.Pen(System.Drawing.Brushes.Yellow, 5); 
                        break; 
                }

                using(Graphics g = Graphics.FromImage(bmp))
                {
                    g.DrawRectangle(pen, blob.Rectangle); 
                }
            }

            BitmapData bmd = bmp.LockBits(
                new System.Drawing.Rectangle(0, 0, bmp.Width, bmp.Height),
                ImageLockMode.ReadWrite,
                bmp.PixelFormat);
            byte[] bytes = new byte[bmd.Stride * bmd.Height];
            Marshal.Copy(bmd.Scan0, bytes, 0, bytes.Length);

            Dispatcher.Invoke((Action)delegate()
            {
                if (_bmp == null)
                {
                    _bmp = new WriteableBitmap(bmp.Width, bmp.Height, 96, 96, PixelFormats.Bgr24, null);
                    VideoWindow.Source = _bmp;
                }

                _bmp.WritePixels(new Int32Rect(0, 0, bmp.Width, bmp.Height), bytes, bmd.Stride, 0); 
            }); 
            
            return; 
        }
开发者ID:kwende,项目名称:SetSpotter,代码行数:56,代码来源:MainWindow.xaml.cs


示例18: FinalFrame_NewFrame

 private void FinalFrame_NewFrame(object sender, NewFrameEventArgs eventArgs)
 {
     try
     {
         picVideo.Image = (Bitmap)eventArgs.Frame.Clone();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
开发者ID:Chuzksy,项目名称:NacossVotingSystem,代码行数:11,代码来源:FrmWebCam.cs


示例19: newFrameEvent

 private void newFrameEvent(object sender, NewFrameEventArgs eventArgs)
 {
     DateTime currentTime = DateTime.Now;
     Graphics graphics = Graphics.FromImage(eventArgs.Frame);
     TextRenderer.DrawText(graphics, currentTime.ToString("dd/mm/yyyy hh:mm:ss"), font, new Point(5, 5),
         Color.White, Color.Black);
     if (recorder != null)
     {
         recorder.AddFrame(eventArgs.Frame);
     }
 }
开发者ID:rpenido,项目名称:ipcam,代码行数:11,代码来源:CameraRecorder.cs


示例20: _videoSource_NewFrame

        void _videoSource_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            if (!_takePicture) return;

            if (eventArgs.Frame.Width == 0)
            {
                return;
            }
            _frame = eventArgs.Frame.Clone() as Bitmap;

            _videoSource.SignalToStop();
        }
开发者ID:hut8,项目名称:selfie-server,代码行数:12,代码来源:Webcam.cs



注:本文中的AForge.Video.NewFrameEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DirectShow.FilterInfoCollection类代码示例发布时间:2022-05-24
下一篇:
C# Neuro.ActivationNetwork类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap