在eclipse上使用c/c++中的opencv进行对象检测
object_detection using opencv in c/c++ on eclipse
我正在尝试从网络摄像头拍摄的视频中检测人脸和眼睛。我在ubuntu 11.10上使用eclipse和openv -2.3.1。我想用C/c++写这个代码。我通过查看教程配置了eclipse。我在网上得到的代码是objectDetection.cpp
我得到的错误如下:
> **** Build of configuration Release for project opencv_try **** make all
> Building file: ../objectDetection2.cpp
> Invoking: GCC C++ Compiler
> g++ -I/home/vidula/OpenCV-2.3.1/include/opencv -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"objectDetection2.d" -MT"objectDetection2.d" -o"objectDetection2.o" "../objectDetection2.cpp"
> Finished building: ../objectDetection2.cpp
> Building target: opencv_try
> Invoking: GCC C++ Linker
> g++ -L/usr/lib -L/home/vidula/OpenCV-2.3.1/lib -L/home/vidula/OpenCV-2.3.1/modules/imgproc/include/opencv2/imgproc -o"opencv_try" ./objectDetection2.o -lopencv_core -lopencv_highgui
> /usr/bin/ld: ./objectDetection2.o: undefined reference to symbol 'cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
> /usr/bin/ld: note: 'cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)' is defined in DSO /usr/local/lib/libopencv_imgproc.so.2.3 so try adding it to the linker command line
> /usr/local/lib/libopencv_imgproc.so.2.3: could not read symbols: Invalid operation collect2: ld returned 1 exit status make:
> *** [opencv_try] Error 1
我试着把它链接到链接器,但我不知道我做错了什么。谁能帮我弄清楚出了什么问题吗?
它看起来像是在告诉你,你需要的cv::cvtColor
符号在libopencv_imgproc
库中,所以你需要用-lopencv_imgproc
选项将它添加到你的链接器选项中,就像你对core
和highgui
所做的那样
相关文章:
- C++OpenCV中的快速索引
- 如何通过opencv中的程序参数定义特征类型?
- 从OpenCV中的三个单个垫子创建BGR垫
- 如何从OpenCV中的目录中按顺序读取文件并使用它进行处理?
- 使用OpENCV中的两个视频仪捕获同一设备
- openCV中的Absdiff可以编译,但显示黑色图像
- opencv中的vec4i是什么
- C OPENCV中的错误是我的第一个代码(中值过滤器)
- 将 openCv 中的曲线从 ROI 转换为帧
- 未定义的参考,差异使用 CUDA 的 OpenCV 中的双边过滤器
- 从直方图OPENCV中的峰中获取色调值
- OpenCV中的MAT和SPARSEMAT有什么区别
- 获取具有X,Y和距离的OPENCV中的3D坐标
- 如何使用Raspberry Pi相机作为C ++ OpenCV中的视频输入
- OpenCV中的Hessian-仿射检测器
- 如何通过Android NDK(C )将图像放入OpenCV中的垫子中
- OPENCV中的GSTREAMER不会通过UDP发送视频数据
- 对于OpenCV中的每个循环
- 快速节省图像到OpenCV中的磁盘
- 如何将 opencv 中的图像数组传递给函数