File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 20
20
#include < opencv2/opencv.hpp>
21
21
22
22
#include < tclap/CmdLine.h>
23
- #include < opencv2/core/ocl.hpp>
23
+
24
+ #include < opencv2/core/version.hpp>
25
+ #if (defined(CV_VERSION_MAJOR) && CV_VERSION_MAJOR == 3)
26
+ #include < opencv2/core/ocl.hpp>
27
+ #endif
24
28
25
29
float ratioRectShapeOverlap (const dest::core::Rect &r, const dest::core::Shape &s) {
26
30
Eigen::Vector2f minC = r.col (0 );
@@ -102,8 +106,10 @@ int main(int argc, char **argv)
102
106
// Note that OpenCV 3.0 / CascadeClassifier seems to have troubles when being reused.
103
107
// Current solution is to disable OpenCL
104
108
// See https://github.com/Itseez/opencv/issues/5475
105
- cv::ocl::setUseOpenCL (false );
106
-
109
+ #if (defined(CV_VERSION_MAJOR) && CV_VERSION_MAJOR == 3)
110
+ cv::ocl::setUseOpenCL (false );
111
+ #endif
112
+
107
113
dest::io::ShapeDatabase sd;
108
114
sd.setMaxImageLoadSize (opts.loadMaxSize );
109
115
You can’t perform that action at this time.
0 commit comments