简单的OpenCV命令在调试模式但不是释放模式下工作 [英] Simple OpenCV command works in Debug mode but not Release mode

查看:192
本文介绍了简单的OpenCV命令在调试模式但不是释放模式下工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图加载一个训练xml文件与 CascadeClassifier :: load(),它的工作原理很好在调试模式,但在发布模式我得到一个运行时错误。

I am trying to load in a training xml file with CascadeClassifier::load(), and it works just fine in Debug mode, but in Release mode I get a runtime error.

我得到的错误是:


未处理的异常0x000007feefbf4938 in Testing.exe:0xC0000005:
访问冲突写入位置0x0000000000000027。

Unhandled exception at 0x000007feefbf4938 in Testing.exe: 0xC0000005: Access violation writing location 0x0000000000000027.

我的代码如下:

CascadeClassifier c;
if (!c.load("C:/data/haarcascade_frontalface_alt.xml"))
{
    exit(1);
}

代码在加载行中崩溃。为什么会发生这种情况?

The code crashes on the loading line. Why would this happen?

推荐答案

确保您在发布模式下运行时链接到openCV的发布dll。我在尝试加载包含混合版本和调试DLL的文件时遇到了类似的问题。

make sure you're linking to openCV's release dlls when running in release mode. I've had similar problems when I tried to load files with mixed release and debug dlls.

请参阅个帖子。

这篇关于简单的OpenCV命令在调试模式但不是释放模式下工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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