This repository was archived by the owner on Jul 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathalvar-compat-opencv-2-3.patch
147 lines (128 loc) · 4.2 KB
/
alvar-compat-opencv-2-3.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bf7615b..e3af316 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -144,7 +144,7 @@ if(UNIX AND PKG_CONFIG_FOUND)
if(NOT TinyXML_FOUND)
find_file(TINYXML_H tinyxml.h)
find_library(TINYXML_SO tinyxml)
- if((${TINYXML_H} EQUAL "TINYXML_H-NOTFOUND") OR (${TINYXML_SO} EQUAL "TINYXML_SO-NOTFOUND"))
+ if((${TINYXML_H} STREQUAL "TINYXML_H-NOTFOUND") OR (${TINYXML_SO} STREQUAL "TINYXML_SO-NOTFOUND"))
message(STATUS "Could not find TinyXML, using bundled version")
add_subdirectory(3rdparty)
else()
diff --git a/sample/GlutViewer.cpp b/sample/GlutViewer.cpp
index 3465efc..b196dfe 100644
--- a/sample/GlutViewer.cpp
+++ b/sample/GlutViewer.cpp
@@ -2,7 +2,14 @@
#include "Rotation.h"
#include "Platform.h"
-#include <opencv2/calib3d/calib3d_c.h>
+
+// Compatibility between OpenCV 2.x and 3.x
+#include <opencv2/core/version.hpp>
+#if CV_MAJOR_VERSION > 2
+ #include <opencv2/calib3d/calib3d_c.h>
+#else
+ #include <opencv2/calib3d/calib3d.hpp>
+#endif
using namespace std;
using namespace alvar;
diff --git a/src/Camera.cpp b/src/Camera.cpp
index d1dc738..5769b6b 100644
--- a/src/Camera.cpp
+++ b/src/Camera.cpp
@@ -26,7 +26,13 @@
#include "FileFormatUtils.h"
#include <memory>
-#include <opencv2/calib3d/calib3d_c.h>
+// Compatibility between OpenCV 2.x and 3.x
+#include <opencv2/core/version.hpp>
+#if CV_MAJOR_VERSION > 2
+ #include <opencv2/calib3d/calib3d_c.h>
+#else
+ #include <opencv2/calib3d/calib3d.hpp>
+#endif
using namespace std;
diff --git a/src/EC.cpp b/src/EC.cpp
index 1b61d8d..1ab6311 100644
--- a/src/EC.cpp
+++ b/src/EC.cpp
@@ -24,7 +24,13 @@
#include "EC.h"
#include "Optimization.h"
-#include <opencv2/calib3d/calib3d_c.h>
+// Compatibility between OpenCV 2.x and 3.x
+#include <opencv2/core/version.hpp>
+#if CV_MAJOR_VERSION > 2
+ #include <opencv2/calib3d/calib3d_c.h>
+#else
+ #include <opencv2/calib3d/calib3d.hpp>
+#endif
namespace alvar {
diff --git a/src/MultiMarkerBundle.cpp b/src/MultiMarkerBundle.cpp
index c93f8f8..1575d71 100644
--- a/src/MultiMarkerBundle.cpp
+++ b/src/MultiMarkerBundle.cpp
@@ -23,7 +23,13 @@
#include "MultiMarkerBundle.h"
-#include <opencv2/calib3d/calib3d_c.h>
+// Compatibility between OpenCV 2.x and 3.x
+#include <opencv2/core/version.hpp>
+#if CV_MAJOR_VERSION > 2
+ #include <opencv2/calib3d/calib3d_c.h>
+#else
+ #include <opencv2/calib3d/calib3d.hpp>
+#endif
using namespace std;
diff --git a/src/Rotation.cpp b/src/Rotation.cpp
index f5b6ef6..33b3836 100644
--- a/src/Rotation.cpp
+++ b/src/Rotation.cpp
@@ -24,7 +24,13 @@
#include "Alvar.h"
#include "Rotation.h"
-#include <opencv2/calib3d/calib3d_c.h>
+// Compatibility between OpenCV 2.x and 3.x
+#include <opencv2/core/version.hpp>
+#if CV_MAJOR_VERSION > 2
+ #include <opencv2/calib3d/calib3d_c.h>
+#else
+ #include <opencv2/calib3d/calib3d.hpp>
+#endif
using namespace std;
diff --git a/src/platform/capture_plugin_file/CapturePluginFile.h b/src/platform/capture_plugin_file/CapturePluginFile.h
index fa5b9b1..eb818f7 100644
--- a/src/platform/capture_plugin_file/CapturePluginFile.h
+++ b/src/platform/capture_plugin_file/CapturePluginFile.h
@@ -21,7 +21,13 @@
* <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>.
*/
-#include <opencv2/videoio.hpp>
+// Compatibility between OpenCV 2.x and 3.x
+#include <opencv2/core/version.hpp>
+#if CV_MAJOR_VERSION > 2
+ #include <opencv2/videoio.hpp>
+#else
+ #include <opencv2/highgui/highgui_c.h>
+#endif
#ifndef CAPTUREPLUGINFILE_H
#define CAPTUREPLUGINFILE_H
diff --git a/src/platform/capture_plugin_highgui/CapturePluginHighgui.h b/src/platform/capture_plugin_highgui/CapturePluginHighgui.h
index cd524d0..8f98bf5 100644
--- a/src/platform/capture_plugin_highgui/CapturePluginHighgui.h
+++ b/src/platform/capture_plugin_highgui/CapturePluginHighgui.h
@@ -21,7 +21,13 @@
* <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>.
*/
-#include <opencv2/videoio.hpp>
+// Compatibility between OpenCV 2.x and 3.x
+#include <opencv2/core/version.hpp>
+#if CV_MAJOR_VERSION > 2
+ #include <opencv2/videoio.hpp>
+#else
+ #include <opencv2/highgui/highgui_c.h>
+#endif
#ifndef CAPTUREPLUGINHIGHGUI_H
#define CAPTUREPLUGINHIGHGUI_H