Error in Using TrackerKCF in Ubuntu /Linux [closed]
I have built successfully OpenCV 3.2 with the extra modules contribution successfully on Ubuntu. However, I'm having an error when building a code that uses (TrackerKCF::MODE), although this code was compiled successfully on Windows. Is there some syntax or includes I need to change or add?
Error Message:
(error: ‘cv::TrackerKCF::MODE’ is not a class or namespace
param.desc_pca = TrackerKCF::MODE::CN | TrackerKCF::MODE::GRAY;
)
Include List:
#include <iostream>
#include <string>
#include "cv.h"
#include "highgui.h"
#include <stdio.h>
#include <opencv2/opencv.hpp>
#include <opencv2/video/video.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/utility.hpp>
#include <opencv2/tracking.hpp>
#include <opencv2/videoio.hpp>
#include <cstdio>
#include <fstream>
#include <sstream>
#include<math.h>
#include<time.h>
For opencv you need only
Now without code it is difficult to test. Difference could be that there is an error in tracker opencv_contrib module for ubuntu.
Thanks. How could I determine or check that?
I don't know linux enough to help you. I think if there is a problem it is in CMake. tracking module needs all this module too opencv_imgproc opencv_core opencv_video opencv_highgui opencv_dnn opencv_plot.
Have you build opencv_contrib ?
Can you find libopencv_tracking.so (check library name)?
Yes they all exist actually
can you compile opencv_contrib/modules/tracking/samples/kcf.cpp
Yes I can. I expect something like a syntax difference when using TrackerKCF::Mode, or in including the required libraries for it in Ubuntu?
It is a compilation error. it cannot be a problem with link libraries. Have you got two versions of opencv on your computer?
you can try something like this if it is possible rename kcf.cpp example. Copy your source file in opencv_contrib/modules/tracking/samples rename it kcf.cpp and build this "new sample"
Could you include the line of code + one or two lines above and below that's causing the error message?
@LBerger, sorry I think I did not give the right answer. When I run opencv_contrib/modules/tracking/samples/kcf.cpp in this directory I get the following error: "error while loading shared libraries: libopencv_tracking.so.3.2: cannot open shared object file: No such file or directory " And I actually have more than one opencv version, but I'm only interested in the latest 3.2
I managed to fix the libopencv_tracking.so error from this link: http://stackoverflow.com/questions/19164343/opencv-libopencv-core-so-2-4-cannot-open-shared-object-file-no-such-file-or (http://stackoverflow.com/questions/19...)
However, now kcf.cpp compiles and I have replaced the file with the file I want to run as you have suggested, but I still get the original error here:
========================================== Thanks much for help so far