X is not a member of 'cv'异常解决

以下四种异常:

'resize' is not a member of 'cv'

'cvtColor' is not a member of 'cv'
'putText' is not a member of 'cv'

'rectangle' is not a member of 'cv'



解决方法:都是加上头文件:


#include "opencv2/imgproc/imgproc.hpp"

(ofc, you have to link opencv_imgproc, too)

#include "opencv2/opencv.hpp"


convertro

是opencv/core库里面的



如果报下面的错:

VideoTest.cpp:(.text+0x6f): undefined reference to `cv::VideoWriter::fourcc(char,char,char, char)'
VideoTest.cpp:(.text+0xc3): undefined reference to `cv::VideoWriter::open(cv::String const&, int, double, cv::Size_, bool)'
VideoTest.cpp:(.text+0x103): undefined reference to `cv::namedWindow(cv::String const&, int)'
VideoTest.cpp:(.text+0x146): undefined reference to `cv::VideoCapture::read(cv::_OutputArray const&)'
VideoTest.cpp:(.text+0x1b1): undefined reference to `cv::imshow(cv::String const&, cv::_InputArray const&)'


解决方法是:

#include "opencv2/videoio.hpp"

also, you don't seem to link to any of the required opencv libs, those are:

opencv_core, opencv_videoio, opencv_highgui


参考网页:

http://stackoverflow.com/questions/27146818/opencv-resize-is-not-a-member-of-cv-opencv-basics

你可能感兴趣的:(opencv基础)