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.
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);
#include <opencv2/imgcodecs.hpp>
solved the problem which contains the imread function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With