JavaEar 专注于收集分享传播有价值的技术资料

opencv2/tracking.hpp: No such file or directory on Ubuntu 16.04

i am working on tracking project so i needed tracking.hpp library. and every time i try to compile the project. it says fatal error: opencv2/tracking.hpp: No such file or directory #include

so i do some search and i found out that i have to download opencv_contrib and build it. and those are the the command line i used to build opencv_contrib.

"cd /home/pixar/Downloads/OpenCV/opencv-3.2.0/build"

"cmake -DOPENCV_EXTRA_MODULES_PATH= /home/Yasd/Downloads/OpenCV/opencv_contrib-master/modules .."

then "make -j5"

but the same error appears. so did i miss something?

1个回答

    最佳答案
  1. Seems like you forgot to run make install command. Go to your build directory and make install Your path to tracking.hpp is wrong. Replace it with actual path

    #include "opencv2/tracking/tracking.hpp"
    

    Also make sure you've added opencv to your project. With cmake it can be done like that:

    find_package(OpenCV REQUIRED)
    include_directories(OpenCV_INCLUDE_DIR)
    

    Source