簡體   English   中英

在Eclipse上使用C / C ++中的OpenCV進行object_detection

[英]object_detection using opencv in c/c++ on eclipse

我正在嘗試通過網絡攝像頭捕獲的視頻檢測面部和眼睛。 我在ubuntu 11.10上使用eclipse和opencv-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將其添加到鏈接器選項中,就像對corehighgui

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM