从OpenCV 3中的VideoCapture获取垫子

时间:2014-09-03 18:53:55

标签: c++ opencv

我试图从相机捕捉视频,我需要能够将帧拉成垫子。我之前在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上运行正常,所以我在这里有点难过。

1 个答案:

答案 0 :(得分:1)

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

相关问题