From 187ab0ca6147ff75da5e08537f5fb93f8e0e6b84 Mon Sep 17 00:00:00 2001 From: laurentBerger Date: Sat, 16 May 2015 19:59:59 +0200 Subject: [PATCH] include cvconfig.h to use constant HAVE_OPENGL --- samples/cpp/detect_mser.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/samples/cpp/detect_mser.cpp b/samples/cpp/detect_mser.cpp index 8631cb7e2..c2d69a93c 100644 --- a/samples/cpp/detect_mser.cpp +++ b/samples/cpp/detect_mser.cpp @@ -1,9 +1,11 @@ #include #include "opencv2/core/opengl.hpp" +#include #include #include #include +#ifdef HAVE_OPENGL #ifdef WIN32 #define WIN32_LEAN_AND_MEAN 1 #define NOMINMAX 1 @@ -20,7 +22,7 @@ #include #include #endif - +#endif using namespace std; @@ -107,6 +109,7 @@ float obsX = (float)0, obsY = (float)0, obsZ = (float)-10, tx = (float)0, ty = ( float thetaObs = (float)-1.570, phiObs = (float)1.570, rObs = (float)10; int prevX=-1,prevY=-1,prevTheta=-1000,prevPhi=-1000; +#ifdef HAVE_OPENGL struct DrawData { @@ -208,9 +211,11 @@ static void onMouse(int event, int x, int y, int flags, void*) } } +#endif void DrawOpenGLMSER(Mat img, Mat result) { +#ifdef HAVE_OPENGL Mat imgGray; if (img.type() != CV_8UC1) cvtColor(img, imgGray, COLOR_BGR2GRAY); @@ -323,6 +328,7 @@ void DrawOpenGLMSER(Mat img, Mat result) } setOpenGlDrawCallback("OpenGL", 0, 0); destroyAllWindows(); +#endif } Mat MakeSyntheticImage()