Ask Your Question
1

Building "Tracking" module in OpenCV extra modules with Cmake does not generate relevant headers of that module

asked 2016-11-16 00:27:51 -0600

vishwanathkr gravatar image

I am not able to get a working custom build for implementation of some OpenCV sample motion tracking examples which requires the module "tracking" part of opencv_contrib. I tried to custom build on on VC12.0 x64 on windows. But it does not generate headers like tracking.hpp and tracker.hpp specific to tracking inside its own folder (C:\OpenCV\build\install\include\opencv2\tracking) like in the case of all other extra modules.

I followed the building procedure as here

My ultimate aim is to run the sample: tutorial_introduction_to_tracker.cpp found here.

Any assistance would be appreciated.

edit retag flag offensive close merge delete

Comments

I don't know why there is a problem but you can try to copy opencv_contrib\modules\tracking\include\opencv2.

Try to build only opencv_tracking in VS 2012 to check if there is an error

LBerger gravatar imageLBerger ( 2016-11-16 01:42:24 -0600 )edit

Error 1 error LNK2001: unresolved external symbol "public: static struct cv::Ptr<class cv::tracker=""> __cdecl cv::Tracker::create(class cv::String const &)" (?create@Tracker@cv@@SA?AU?$Ptr@VTracker@cv@@@2@AEBVString@2@@Z) E:\OneDrive\Projects\Projects 3.1\tracking\tracking\Source1.obj tracking

vishwanathkr gravatar imagevishwanathkr ( 2016-11-16 13:08:42 -0600 )edit

Can you build opencv_tracking using visual studio solution?

LBerger gravatar imageLBerger ( 2016-11-16 13:45:08 -0600 )edit
1

Actually CMake does not build it.

OpenCV modules:
    To be built:                 cudev core cudaarithm flann imgproc ml video cudabgsegm cudafilters cudaimgproc cudawarping imgcodecs photo shape videoio cudacodec highgui objdetect ts features2d calib3d cudafeatures2d cudalegacy cudaobjdetect cudaoptflow cudastereo stitching superres videostab python2
    Disabled:                    world
    Disabled by dependency:      tracking
    Unavailable:                 java python3 viz
vishwanathkr gravatar imagevishwanathkr ( 2016-11-16 15:59:20 -0600 )edit
1

I think there is a problem other module check if modules in CMakeLists.txt are present

LBerger gravatar imageLBerger ( 2016-11-17 02:01:37 -0600 )edit

try to enable the opencv_datasets module

(afaik, it's only needed for one of the samples, so it should be rather OPTIONAL, imho)

berak gravatar imageberak ( 2016-11-17 03:40:02 -0600 )edit

It does not work if I include datasets module.

OpenCV modules:
    To be built:                 cudev core cudaarithm flann imgproc ml video cudabgsegm cudafilters cudaimgproc cudawarping imgcodecs photo shape videoio cudacodec highgui objdetect ts features2d calib3d cudafeatures2d cudalegacy cudaobjdetect cudaoptflow cudastereo stitching superres videostab python2
    Disabled:                    world
    Disabled by dependency:      datasets tracking
    Unavailable:                 java python3 viz
vishwanathkr gravatar imagevishwanathkr ( 2016-11-21 14:54:21 -0600 )edit

Something is wrong in your install. You should delete everything (if it is possible) 0 cd \lib 1 git clone https://github.com/opencv/opencv.git

2 git clone https://github.com/opencv/opencv_cont...

3 run cmakegui:

where is source file = \lib\opencv

where to build \lib\opencv\build

4 press configure

5 give OPENCV_EXTRA_MODULES_PATH = \lib\opencv_contrib\modules

6 press generate

LBerger gravatar imageLBerger ( 2016-11-21 15:15:00 -0600 )edit

@LBerger Thanks for your help. But still unsuccessful. Here is the entire Cmake config file. here

vishwanathkr gravatar imagevishwanathkr ( 2016-11-21 15:38:49 -0600 )edit

My configuration : General configuration for OpenCV 3.1.0-dev ===================================== If you clone repo you should have dev

Version control: unknown

Extra modules:

***Location (extra):            F:/lib/opencv_contrib/modules*** why haven't got you that?

Version control (extra):     unknown
LBerger gravatar imageLBerger ( 2016-11-21 15:51:26 -0600 )edit

1 answer

Sort by » oldest newest most voted
1

answered 2019-09-29 13:31:31 -0600

sammi gravatar image

I have the same issue and finally solved by reinstalling again and again until this link: link text I guess my Ubuntu 18 lacked some dependencies and the instruction above fixed for me. then after the $cmake ........ I got:

-- General configuration for OpenCV 4.1.0 =====================================

-- Version control: 4.1.0

-- Extra modules: -- Location (extra): /home/parallels/opencv_build/opencv_contrib/modules -- Version control (extra): 4.1.1-49-gdda33bf3

. . .

-- OpenCV modules: -- To be built: aruco bgsegm bioinspired calib3d ccalib core cvv datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy gapi hdf hfs highgui img_hash imgcodecs imgproc line_descriptor ml objdetect optflow phase_unwrapping photo plot python2 python3 quality reg rgbd saliency sfm shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab viz xfeatures2d ximgproc xobjdetect xphoto

added extra more module but "tracking" is there! Then after build and install, in “/usr/local/lib”, I see

libopencv_tracking.so ->libopencv_tracking.so.4.1 libopencv_tracking.so.4.1 ->libopencv_tracking.so.4.1.0 libopencv_tracking.so.4.1.0

The error on the code for opencv2/tracking.hpp is gone!

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-11-16 00:27:51 -0600

Seen: 5,458 times

Last updated: Sep 29 '19