imread不工作在Opencv [英] imread not working in Opencv

查看:164
本文介绍了imread不工作在Opencv的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用OpenCV2.2中的 imread 函数。



我的代码很简单。

  cv :: Mat host = imread(1.bmp,CV_LOAD_IMAGE_GRAYSCALE); 

之后,主机矩阵被零点指针填充,即图像尚未加载。 p>

如果我使用 cvLoadImage ,那么一切正常。



文件存在,我不混合发布和调试库。为什么 imread 不起作用?

解决方案

8。



如果您正在Debug中运行,请检查您是否也在使用调试库,它修复了我们的问题。 : OpenCV imread(filename)在调试模式下失败,使用发布库


I'm trying to use the imread function from OpenCV2.2.

My code is very simple.

cv::Mat host= imread("1.bmp", CV_LOAD_IMAGE_GRAYSCALE);

After that, the host matrix became filled by zeros pointers, i.e. an image has not loaded.

If I use cvLoadImage then it all works properly.

The file exists, and I am not mixing the release and debug libraries. Why imread doesn't work?

解决方案

Reproduced with opencv 2.4.8.

If you are running in Debug, check that you are also using debug libraries, it fixed our problem. : OpenCV imread(filename) fails in debug mode when using release libraries.

这篇关于imread不工作在Opencv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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