此教程使用emgu3.0.0,其他版本兼容性未知。

  转载请注明出处: http://www.cnblogs.com/zaiyuzhong/p/open-camera-with-emgu3_0_0.html

先说设置帧率,是通过调用Capture实例的SetCaptureProperty方法:

  capture.SetCaptureProperty(CapProp.Fps, 帧率数);

该方法可以设置绝大多数摄像头参数。相应的,可以通过GetCaptureProperty获得这些参数。

该示例只需引用 Emgu.CV.dll 和 Emgu.Util.dll

 1 var capture = new Capture(0); //这里打开第一个, 多个摄像头先获取名字数组, 再根据名字获得对应下标
 2 capture.SetCaptureProperty(CapProp.Fps, 1);
 3 var ts = new ThreadStart(() => 
 4 {
 5     while(!shouldStop)
 6     {
 7         var image = capture.QueryFrame(); // image是Emgu.CV.Mat类型
 8     }
 9 });
10 shouldStop = false;
11 new Thread(ts){ IsBackground = true }.Start();
打开摄像头

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-21
  • 2022-01-13
  • 2021-09-14
  • 2022-12-23
  • 2021-09-17
  • 2021-09-24
相关资源
相似解决方案