Cv :: Mat gives error with Visual C ++ Express 2010

I have opencv2.1 and coding in Visual C ++ 2010 Express on a 64 bit computer. I had no problems before, I could work with other codes, however the following simple code gives an error:

Unhandled exception in 0x571365af (msvcr90d.dll) in cvMatExample.exe: 0xC0000005: Access violation read location 0x6d622e65.

#include "cvaux.h" #include "highgui.h" #include <stdio.h> using namespace cv; using namespace std; int main(){ Mat xxx; xxx= imread("frame.bmp",0); namedWindow("Result",CV_WINDOW_AUTOSIZE); imshow("Result", xxx); return 0; } 

So where exactly is the problem? or cv :: Mat is not compatible with my computer? Thanks in advance.

+1
source share
2 answers

It is good practice to check the return of a function call when you can:

 xxx = imread("frame.bmp",0); if (!xxx .data) { printf("Failed to load image\n"); // deal with error } 

Your image may not have been loaded by imread() . On Windows, a common path with double slashes is often found: C:\\folder\\another_folder\\img.jpg

+1
source

I had exactly the same problem. What worked for me is to restore my .Net installation with this:

http://www.microsoft.com/en-us/download/details.aspx?id=17718

Then reboot when asked.

amuses

+1
source

Source: https://habr.com/ru/post/976545/


All Articles