[英]C++ OpenCV 0xC0000005 error while reading from camera
As said I get a 0xC0000005 reading access violation error realted to VSFilter.dll when I try to get a frame from the camera. 如前所述,当我尝试从相机获取帧时,收到了一个0xC0000005读取访问冲突错误,该错误已呈现到VSFilter.dll。 I've tried different sample code found online and in the OpenCV documentation but I still get the error. 我尝试了在线和OpenCV文档中找到的其他示例代码,但仍然收到错误。 For example this is the code I'm using now: 例如,这是我现在使用的代码:
#include <opencv/cv.h>
#include <opencv/highgui.h>
using namespace cv;
int main(int, char**)
{
VideoCapture cap(0);
if(!cap.isOpened()) return -1;
Mat frame;
namedWindow("Camera",1);
while(1)
{
cap >> frame;
imshow("Camera", frame);
if(waitKey(30) >= 0) break;
}
return 0;
}
And in the output there are this two errors (a first-chance exeption and an unhandled exeption, sorry for the italian): 在输出中有两个错误(第一个机会出局和未处理的出局,对不起意大利人):
Eccezione first-chance in 0x000007FEEB115791 (VSFilter.dll) in OpenCV.exe: 0xC0000005: violazione di accesso durante la scrittura del percorso 0x000000000468E000.
Eccezione non gestita in 0x000007FEEB115791 (VSFilter.dll) in OpenCV.exe: 0xC0000005: violazione di accesso durante la scrittura del percorso 0x000000000468E000.
So the code is pretty simple and it shouldn't be the problem, I am wondering why the error is related to VSFilter.dll (VobSub & TextSub filter for DirectShow/VirtualDub/Avisynth)? 所以代码很简单,不应该是问题,我想知道为什么错误与VSFilter.dll(DirectShow / VirtualDub / Avisynth的VobSub和TextSub过滤器)有关?
I'm using OpenCV 2.4.5 and VisulaStudio 2012. 我正在使用OpenCV 2.4.5和VisulaStudio 2012。
I've downloaded VSFilter.dll and replaced the original one in Windows/system32/, now everything work! 我已经下载了VSFilter.dll并替换了Windows / system32 /中的原始文件,现在一切正常!
any chance, you ended up in "dll hell" ? 有机会,您最终陷入“ dll地狱”吗?
like: 喜欢:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.