2014-09-03 76 views
1

我試圖從相機捕獲視頻,並且需要能夠將框架作爲墊子進行拉取。我之前在C++中使用OpenCV 2.4.9,但是使用最新的3.0構建我的程序崩潰。從OpenCV 3中的VideoCapture獲取墊子

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

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