访问冲突阅读位置-opencv/VC ++ [英] Access Violation reading location - opencv/VC++

查看:190
本文介绍了访问冲突阅读位置-opencv/VC ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将OpenCV与VC ++一起使用.该函数正在执行应做的事情,但会引发异常,这会导致读取位置并引用ntdll.dll时导致访问冲突.我会在代码执行应做的事情时因无法处理异常而错过什么?

I am using OpenCV with VC++. The function is doing what it ought do but throwing an exception which is causing access violation in reading a location and refers to ntdll.dll. What would I missing for being unable to handle the exception when the code is doing what it should do ?

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).

推荐答案

我遇到了相同的错误,请在

I had the same error, check your environment variables in

控制面板->系统->高级系统设置->环境变量->路径

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

确保将opencv bin路径添加到环境路径",然后重新启动计算机.

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

应该可以

这篇关于访问冲突阅读位置-opencv/VC ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆