ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations)
-ocv_define_module(gpunvidia opencv_core opencv_objdetect)
+ocv_define_module(gpunvidia opencv_core OPTIONAL opencv_objdetect)
static void groupRectangles(std::vector<NcvRect32u> &hypotheses, int groupThreshold, double eps, std::vector<Ncv32u> *weights)
{
+#ifndef HAVE_OPENCV_OBJDETECT
+ (void) hypotheses;
+ (void) groupThreshold;
+ (void) eps;
+ (void) weights;
+ CV_Error(cv::Error::StsNotImplemented, "This functionality requires objdetect module");
+#else
std::vector<cv::Rect> rects(hypotheses.size());
std::transform(hypotheses.begin(), hypotheses.end(), rects.begin(), RectConvert());
}
std::transform(rects.begin(), rects.end(), hypotheses.begin(), RectConvert());
hypotheses.resize(rects.size());
+#endif
}
#include "opencv2/core/cuda/warp.hpp"
#include "opencv2/core/cuda/warp_shuffle.hpp"
-#include "opencv2/objdetect.hpp"
+
+#include "opencv2/opencv_modules.hpp"
+
+#ifdef HAVE_OPENCV_OBJDETECT
+# include "opencv2/objdetect.hpp"
+#endif
#include "opencv2/gpunvidia/NCV.hpp"
#include "opencv2/gpunvidia/NPP_staging.hpp"
std::vector<HaarClassifierNode128> &haarClassifierNodes,
std::vector<HaarFeature64> &haarFeatures)
{
+#ifndef HAVE_OPENCV_OBJDETECT
+ (void) filename;
+ (void) haar;
+ (void) haarStages;
+ (void) haarClassifierNodes;
+ (void) haarFeatures;
+ CV_Error(cv::Error::StsNotImplemented, "This functionality requires objdetect module");
+ return NCV_HAAR_XML_LOADING_EXCEPTION;
+#else
NCVStatus ncvStat;
haar.NumStages = 0;
}
return NCV_SUCCESS;
+#endif
}
#include "opencv2/gpunvidia.hpp"
#include "opencv2/core/utility.hpp"
-#include "opencv2/objdetect.hpp"
+
+#include "opencv2/opencv_modules.hpp"
+
+#ifdef HAVE_OPENCV_OBJDETECT
+# include "opencv2/objdetect.hpp"
+#endif
#include "opencv2/core/gpu_private.hpp"
#include "opencv2/gpunvidia/private.hpp"