tracking: make datasets dependancy optional

added error msg for samples
pull/865/head
berak 8 years ago
parent b7dcf14150
commit e2c4574f73
  1. 2
      modules/tracking/CMakeLists.txt
  2. 13
      modules/tracking/samples/multiTracker_dataset.cpp
  3. 19
      modules/tracking/samples/tracker_dataset.cpp

@ -1,2 +1,2 @@
set(the_description "Tracking API")
ocv_define_module(tracking opencv_imgproc opencv_core opencv_video opencv_highgui opencv_datasets WRAP python)
ocv_define_module(tracking opencv_imgproc opencv_core opencv_video opencv_highgui OPTIONAL opencv_datasets WRAP python)

@ -39,6 +39,10 @@
//
//M*/
#include "opencv2/opencv_modules.hpp"
#include "opencv2/core.hpp"
#ifdef HAVE_OPENCV_DATASETS
#include "opencv2/datasets/track_vot.hpp"
#include <opencv2/core/utility.hpp>
#include <opencv2/tracking.hpp>
@ -227,4 +231,11 @@ int main(int argc, char *argv[])
waitKey(0);
return 0;
}
}
#else // ! HAVE_OPENCV_DATASETS
int main() {
CV_Error(cv::Error::StsNotImplemented , "this sample needs to be built with opencv_datasets !");
return -1;
}
#endif // HAVE_OPENCV_DATASETS

@ -39,6 +39,14 @@
//
//M*/
//
// !!! this sample requires the opencv_datasets module !!!
//
#include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_DATASETS
#include "opencv2/datasets/track_vot.hpp"
#include <opencv2/core/utility.hpp>
#include <opencv2/tracking.hpp>
@ -221,4 +229,13 @@ int main(int argc, char *argv[])
waitKey(0);
return 0;
}
}
#else // ! HAVE_OPENCV_DATASETS
int main() {
CV_Error(cv::Error::StsNotImplemented , "this sample needs to be built with opencv_datasets !");
return -1;
}
#endif // HAVE_OPENCV_DATASETS

Loading…
Cancel
Save