Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/141.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ VideoCapture赢得';t在2.4.9中打开_C++_Opencv - Fatal编程技术网

C++ VideoCapture赢得';t在2.4.9中打开

C++ VideoCapture赢得';t在2.4.9中打开,c++,opencv,C++,Opencv,我意识到这之前已经发布过了,但我无法从以前的帖子中收集到任何信息(大多数都是在以前的版本中,解决方案是一个错误修复) 我刚刚从3.0.0降级到2.4.9,当时有人告诉我我退出了错误的回购协议。在此之前,由于从2.4.9到3.0.0所做的更改,我在编译ARUco库时遇到了常量问题,因此更改显然起到了我现在可以编译的效果。然而,我以前运行的程序现在无法打开VideoCapture对象。我之所以知道这一点,是因为下面代码中的断言assert(webCamL.isOpened())失败,并且删除断言时返

我意识到这之前已经发布过了,但我无法从以前的帖子中收集到任何信息(大多数都是在以前的版本中,解决方案是一个错误修复)

我刚刚从3.0.0降级到2.4.9,当时有人告诉我我退出了错误的回购协议。在此之前,由于从2.4.9到3.0.0所做的更改,我在编译ARUco库时遇到了常量问题,因此更改显然起到了我现在可以编译的效果。然而,我以前运行的程序现在无法打开VideoCapture对象。我之所以知道这一点,是因为下面代码中的断言
assert(webCamL.isOpened())
失败,并且删除断言时返回的帧为空

webcamL = cv::VideoCapture(0);
assert(webcamL.isOpened());
Mat tmp;

webcamL.read(tmp);

int width       = webcamL.get(CV_CAP_PROP_FRAME_WIDTH);
int height      = webcamL.get(CV_CAP_PROP_FRAME_HEIGHT);

cout << width << " " << height << endl << tmp.size().width << " " << tmp.size().height << endl;
webcamL=cv::VideoCapture(0);
断言(webcamL.isopend());
Mat-tmp;
webcamL.read(tmp);
int width=webcamL.get(CV\u CAP\u PROP\u FRAME\u width);
int height=webcamL.get(CV\U CAP\U PROP\U FRAME\U height);

对我来说,视频捕获在调试模式下无法工作。您可以尝试在发布模式下运行代码,看看是否有帮助?通过添加所需的
dll
s检查是否有帮助。