我收到此错误:
usr/bin/ld: CMakeFiles/stereo_img.dir/stereo_img.cpp.o: undefined reference to symbol '_ZN2cv8cvtColorERKNS_11_InputArrayERKNS_12_OutputArrayEii'
//usr/lib/x86_64-linux-gnu/libopencv_imgproc.so.2.4: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
在我的CmakeLists.txt中,我添加了:
add_definitions(-lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_nonfree -lopencv_objdetect -lopencv_features2d )
我正在使用这些包括:
#include "opencv2/opencv.hpp"
#include "opencv2/gpu/gpu.hpp"
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
我可以使用opencv中的其他类型,例如cv::Mat
。