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

copencvtrackingUbuntu

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?

Best Answer

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