Tried to compile tracker from tutorial and got error "‘Tracker’ was not declared in this scope Ptr<Tracker> tracker = TrackerKCF::create();" [closed]
Tried to compile tracker https://docs.opencv.org/3.1.0/d2/d0a/... and got error
"/home/vioh/tracker2/tracker2.cpp: In function ‘int main(int, char**)’:
/home/vioh/tracker2/tracker2.cpp:24:7: error: ‘Tracker’ was not declared in this scope
Ptr<Tracker> tracker = TrackerKCF::create();
^
/home/vioh/tracker2/tracker2.cpp:24:14: error: template argument 1 is invalid
Ptr<Tracker> tracker = TrackerKCF::create();
^
/home/vioh/tracker2/tracker2.cpp:24:26: error: ‘TrackerKCF’ has not been declared
Ptr<Tracker> tracker = TrackerKCF::create();
^
/home/vioh/tracker2/tracker2.cpp:35:10: error: base operand of ‘->’ is not a pointer
tracker->init(frame,roi);
^
/home/vioh/tracker2/tracker2.cpp:45:12: error: base operand of ‘->’ is not a pointer
tracker->update(frame,roi);
^
CMakeFiles/tracker2.dir/build.make:62: recipe execution error for goal «CMakeFiles/tracker2.dir/tracker2.cpp.o»
make[2]: *** [CMakeFiles/tracker2.dir/tracker2.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe execution error for goal «CMakeFiles/tracker2.dir/all»
make[1]: *** [CMakeFiles/tracker2.dir/all] Error 2
Makefile:83: recipe execution error for goal «all»
make: *** [all] Error 2
"
I have opencv 3.4.3 and installed all modules
please use current docs, not outdated 3.1.0
you also need the opencv_contrib modules
I have opencv contrib modules, but now I just can't include necessary hpp to the program.
which means ?
which opencv version are you using, exactly ? (there is a version box in the opencv docs, make sure you use the correct tutorial code !)
Sorry, I was using
#include <opencv2/tracking.hpp>
at first, but it couldn't find file, then I tried some other paths and it didn't work too, at the end I just used#include <opencv2/tracking.hpp>
again and now its working, I don't know why. Thanks for help :)ok, "rubber duck debugging" ;)
https://en.wikipedia.org/wiki/Rubber_... is it?
yea, exactly ;)