Skip to content

Instantly share code, notes, and snippets.

@vedantk
Created May 30, 2011 20:37
Show Gist options
  • Save vedantk/999427 to your computer and use it in GitHub Desktop.
Save vedantk/999427 to your computer and use it in GitHub Desktop.
opencv 2.2 for mldemos (non-hacky version)
From 207a4c622081c32ebcb25ce0825e6c7704f81ac0 Mon Sep 17 00:00:00 2001
From: Vedant Kumar <vk@vedantk.com>
Date: Mon, 30 May 2011 16:37:55 -0400
Subject: [PATCH] Added compat headers, removed hacky cvSumPixels workaround
---
MLDemos/public.h | 9 ++++-----
MLDemos/sampleManager.cpp | 4 ++--
MLDemos_variables.pri | 3 +--
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/MLDemos/public.h b/MLDemos/public.h
index 55e6b05..7ee3cc4 100644
--- a/MLDemos/public.h
+++ b/MLDemos/public.h
@@ -31,12 +31,11 @@ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#endif
// opencv includes
-#include "cv.h"
-#include "cvaux.h"
-#include "highgui.h"
-/*#include <opencv.hpp>
+#include <opencv.hpp>
#include <imgproc/imgproc.hpp>
-#include <ml/ml.hpp>*/
+#include <ml/ml.hpp>
+#include <opencv2/legacy/legacy.hpp>
+#include <opencv2/legacy/compat.hpp>
// types and macros
#include "types.h"
diff --git a/MLDemos/sampleManager.cpp b/MLDemos/sampleManager.cpp
index 269e1ba..fd07997 100644
--- a/MLDemos/sampleManager.cpp
+++ b/MLDemos/sampleManager.cpp
@@ -522,13 +522,13 @@ bool SampleManager::Load(const char *filename, CvSize resolution)
continue;
}
- /*if (cvSumPixels(sample) == 0)
+ if (cvSumPixels(sample) == 0)
{
IMKILL(sample);
bDone = true;
}
else
- */{
+ {
samples.push_back(sample);
flags.push_back(UNUSED);
//labels.push_back(0);
diff --git a/MLDemos_variables.pri b/MLDemos_variables.pri
index eb7f282..3bf4aa3 100644
--- a/MLDemos_variables.pri
+++ b/MLDemos_variables.pri
@@ -61,12 +61,11 @@ INCLUDEPATH += . \
/usr/include/qt4/QtCore/ \
/usr/include/qt4/QtGui/ \
/usr/include/qt4/QtOpenGL \
- /usr/include/opencv/ \
/usr/include/opencv2 \
/usr/local/include/opencv/
LIBS += -L/usr/local/lib
LIBS += -lopencv_highgui -lopencv_core -lopencv_imgproc -lopencv_ml \
- -lopencv_video -lopencv_features2d \
+ -lopencv_video -lopencv_features2d -lopencv_legacy \
}
INCLUDEPATH += $$MLDEMOS
--
1.7.5.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment