【问题标题】:Get mat from VideoCapture in OpenCV 3从 OpenCV 3 中的 VideoCapture 获取垫子
【发布时间】:2014-09-03 18:53:55
【问题描述】:

我正在尝试从相机捕捉视频,我需要能够将帧拉为 Mat。我以前在 C++ 中的 OpenCV 2.4.9 中做过这个,但是使用最新的 3.0 构建我的程序崩溃了。

Mat frame;
VideoCapture capture;
capture = VideoCapture(0);
if (!capture.isOpened())
{
    // Just a check. Program does not enter this
}

m_capture >> m_frame; // Program breaks here

相同的代码在 2.4.9 上运行良好,所以我有点难过。

【问题讨论】:

    标签: c++ opencv


    【解决方案1】:

    我想通了。而不是 capture = VideoCapture(0);我只需要做 m_capture.open(0);

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-05
      • 1970-01-01
      • 2019-05-18
      • 1970-01-01
      • 2014-05-07
      • 1970-01-01
      相关资源
      最近更新 更多