error: imread is not a member of cv

匿名 (未验证) 提交于 2019-12-03 02:31:01

问题:

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

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

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

I use:

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

on terminal to compile.

Any suggest? Regards. Can.

回答1:

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


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!