使用版本库时,OpenCV imread(filename)在调试模式下失败 [英] OpenCV imread(filename) fails in debug mode when using release libraries

查看:181
本文介绍了使用版本库时,OpenCV imread(filename)在调试模式下失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些 C ++ 代码,除了 imread(file)函数, OpenCV 正在找到正确的文件并加载名称,但它没有加载任何数据。

I have some C++ code and everything was working fine with OpenCV except the function imread(file). It was finding correctly the file and loading the name, but it wasn't loading any data.

Mat pattImage = imread(fileName, 0);

在web上进行一些重做之后,我意识到我在调试模式,但是发布 OpenCV 库,而不是调试。

After some reaserch on the web I realized that I was in debug mode but with the release OpenCV libraries, instead of the debug ones.

debug library:    opencv_core231d.lib
release library:  opencv_core231.lib

虽然这是一个棘手的愚蠢的错误,我认为这不应该做什么,调试库应该允许 OpenCV 代码调试,而发布库允许更快地执行代码,但我不明白为什么imread失败。

Though it is the tipical stupid error I thought this shouldn't have anything to do, the debug libraries are supposed to allow OpenCV code debugging while the release libraries allow faster execution of the code, but I don't understand why imread was failing.

任何人都可以解释一下 > debug 发布库,为什么会出现此错误?

Can anybody explain me the differences between debug and release libraries in OpenCV and why this error occurs?

OpenCV 错误吗?

推荐答案

我永远不会厌ired告诉人们 Windows的C ++ OpenCV界面有最难的错误

I'll never get tired of telling people that the C++ OpenCV interface for Windows has the wierdest bugs.

使用C接口编写一个小测试,以检查它是否工作( cvLoadImage()等) 。

Write a small test using the C interface to check if it works or not (cvLoadImage(), etc).

更新:现在您知道C接口正常工作,您可以转到邮件列表并报告此处的错误挖掘代码自己找到为什么它失败。

Update: now that you know that the C interface works properly, you can either go to the mailing list and report this bug there or dig into the code yourself to find why it fails.

这篇关于使用版本库时,OpenCV imread(filename)在调试模式下失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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