tracking: make datasets dependancy optional

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

@ -1,2 +1,2 @@
set(the_description "Tracking API") 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*/ //M*/
#include "opencv2/opencv_modules.hpp"
#include "opencv2/core.hpp"
#ifdef HAVE_OPENCV_DATASETS
#include "opencv2/datasets/track_vot.hpp" #include "opencv2/datasets/track_vot.hpp"
#include <opencv2/core/utility.hpp> #include <opencv2/core/utility.hpp>
#include <opencv2/tracking.hpp> #include <opencv2/tracking.hpp>
@ -228,3 +232,10 @@ int main(int argc, char *argv[])
return 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*/ //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/datasets/track_vot.hpp"
#include <opencv2/core/utility.hpp> #include <opencv2/core/utility.hpp>
#include <opencv2/tracking.hpp> #include <opencv2/tracking.hpp>
@ -222,3 +230,12 @@ int main(int argc, char *argv[])
return 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