错误:imread 不是 cv 的成员 [英] error: imread is not a member of cv

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

问题描述

我使用 OpenCV 3.0 和 Ubuntu 14.04.我正在尝试使用 opencv 在 ubuntu 上编译一些代码.我收到错误

I use OpenCV 3.0 and Ubuntu 14.04. I'm trying to compile a few codes on ubuntu using opencv. I get error

"错误:'imread' 不是 'cv' 的成员"

"error: 'imread' is not a member of 'cv'"

由于我之前的搜索知识,我尝试通过添加highgui.h"来编译.

Due to my previous search knowledge, I tried compiling by adding "highgui.h".

我使用:

$g++ main.cpp HOG.cpp HOGFeaturesOfBlock.cpp -I/usr/local/include/opencv -lml -lcvaux -highgui -lcv -lcxcore -o featureExtractor

在终端上编译.

有什么建议吗?问候.可以.

Any suggest? Regards. Can.

推荐答案

以下命令应该可以工作.如果它不起作用,您应该检查是否正确设置了包含/lib 文件.

The following commands should work. If it doesn't work you should check if you set the include/lib files correctly.

#include <opencv2\highgui\highgui.hpp>
#include <opencv2\core\core.hpp>
#include <opencv\cv.hpp>

using namespace cv;

Mat image = imread(filename, CV_LOAD_IMAGE_COLOR);

这篇关于错误:imread 不是 cv 的成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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