Classification: Fix OpenCV includes (#4241)

Classification: Fix OpenCV includes

Co-authored-by: Maxime GIMENO <maxime.gimeno@gmail.com>
This commit is contained in:
Laurent Rineau 2019-09-27 16:16:21 +02:00 committed by GitHub
commit 5e64fde466
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 7 deletions

View File

@ -18,7 +18,7 @@ do
DONE=1 && sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install clang-3.6 zsh \
flex bison cmake graphviz libgmp-dev libmpfr-dev libmpfi-dev zlib1g-dev libeigen3-dev libboost1.55-dev \
libboost-system1.55-dev libboost-program-options1.55-dev libboost-thread1.55-dev libboost-iostreams1.55-dev \
qt55base qt55script qt55svg qt55tools qt55graphicaleffects libopencv-dev mesa-common-dev libmetis-dev libglu1-mesa-dev \
qt55base qt55script qt55svg qt55tools qt55graphicaleffects libopencv-dev libopencv-ml-dev mesa-common-dev libmetis-dev libglu1-mesa-dev \
|| DONE=0 && sudo apt-get update
done
exit 0

View File

@ -25,13 +25,23 @@
#include <CGAL/Classification/Feature_set.h>
#include <CGAL/Classification/Label_set.h>
#if (CV_MAJOR_VERSION < 3)
#include <cv.h>
#include <ml.h>
#include <opencv2/opencv.hpp>
//In opencv version 2.X the first digit is named EPOCH,
//until version 3.0 where EPOCH disappears and it becomes MAJOR. Hence this
//weird condition
#ifdef CV_VERSION_EPOCH
#if CV_VERSION_MAJOR == 4 && CV_VERSION_MINOR>= 11
#include <opencv2/ml.hpp>
#else
#include <opencv2/ml/ml.hpp>
#endif
#else
#include <opencv/cv.h>
#include <opencv/ml.h>
#endif
#include <opencv2/ml.hpp>
#endif`
namespace CGAL {