0

我正在使用带有 VC++ 的 OpenCV。该函数正在做它应该做的事情,但抛出一个异常,这会在读取位置并引用 ntdll.dll 时导致访问冲突。当代码正在做它应该做的事情时,我会因为无法处理异常而错过什么?

void cl::first()
{
  Mat a=imread("C:\\1.jpg");
  Mat b;
  cvtColor(a,b,CV_RGB2BGR);
  imwrite("C:\\2.jpg",b);
  return ;
}

例外

First-chance exception at 0x77551e86 (ntdll.dll) in app.exe: 0xC0000005: 
Access violation reading location 0x43819ccc. Unhandled exception at 0x77551e86 (ntdll.dll) 
in app.exe: 0xC0000005: Access violation reading location 0x43819ccc. 
The program '[4500] app.exe: Native' has exited with code -1073741819 (0xc0000005).
4

1 回答 1

1

I had the same error, check your environment variables in

control panel->system-> advanced system settings->environment variables->path

to ensure opencv bin path is added to the environment 'path', then restart your computer.

That should work

于 2017-01-21T02:08:28.037 回答