I installed OpenCV version 2.4.3 using Visual Sudio 10 as the IDE (on windows 7 64-bit). The problem is that once I installed it and am running even a simple application like that of loading an image it is giving me an error
The program '[8120] pms1.exe: Native' has exited with code -1073741811 (0xc000000d)
I am getting the same error for any code that I am trying to run. I am not getting any build errors. Build is getting succeeded but when I run it it throws me this.
Note: a sample code which gave me the error
#include <opencv\cv.h>
#include <opencv\highgui.h>
using namespace cv;
int main()
{
Mat image;
VideoCapture cap;
cap.open(0);
namedWindow(“window”, 1);
while(1) {
cap>>image;
imshow(“window”, image);
waitKey(33);
}
return 0;
}
Make sure that your executable and the opencv dll files it calls are both 32-bit or 64-bit.
Most probably the capture interface failed to open device 0
, so cap>>image;
is probably causing the error. You just don't know it because you forgot to check the success of open()
:
VideoCapture cap;
cap.open(0);
if (!cap.isOpened())
{
// print error message and
// quit the application
}
Experiment to pass other values for open()
, like -1 or 2.
User contributions licensed under CC BY-SA 3.0