opencv: Fixup include to follow new standard
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 2 Aug 2018 15:19:07 +0000 (11:19 -0400)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 2 Aug 2018 15:31:34 +0000 (11:31 -0400)
This uses the new path for OpenCV headers. OpenCV now have
master headers files per modules, which reduce the amount of
required includes. Note that HIGHGUI was included to get the
imgcodecs includes, which I fixed, though the master header is
missing the C headers, so I included that directly. All the
image stuff should be ported to C++ eventually. Finally, this
patch also update the header checks to reflect the modules that
are really being used.

configure.ac
ext/opencv/MotionCells.h
ext/opencv/gsthanddetect.h
ext/opencv/gsttemplatematch.cpp
ext/opencv/gsttemplatematch.h
ext/opencv/meson.build
meson.build

index db1f3cb7d8b9bc4a8325eb7d3b5540149612d63a..36b3a548bdb562f7c2c177402b79c5e1c908985f 100644 (file)
@@ -1891,13 +1891,14 @@ AG_GST_CHECK_FEATURE(OPENCV, [opencv plugins], opencv, [
     OLD_CPPFLAGS=$CPPFLAGS
     CPPFLAGS=$OPENCV_CFLAGS
     something_not_found=no
-    AC_CHECK_HEADERS([opencv2/core/core_c.h \
-                      opencv2/core/version.hpp \
-                      opencv2/highgui/highgui_c.h \
-                      opencv2/imgproc/imgproc.hpp \
-                      opencv2/imgproc/imgproc_c.h \
-                      opencv2/objdetect/objdetect.hpp \
-                      opencv2/video/background_segm.hpp \
+    AC_CHECK_HEADERS([opencv2/bgsegm.hpp \
+                      opencv2/calib3d.hpp \
+                      opencv2/core.hpp \
+                      opencv2/imgcodecs/imgcodecs_c.h \
+                      opencv2/imgproc.hpp \
+                      opencv2/objdetect.hpp \
+                      opencv2/opencv.hpp \
+                      opencv2/video.hpp \
                       opencv2/bgsegm.hpp], [], [something_not_found=yes])
 
     CPPFLAGS=$OLD_CPPFLAGS
index 96b048379d6c7c43a6c244e03c6bcccf79fefcd9..6df49abb6ab5b9ff792cd0ea0b5c70c58e5da9c3 100644 (file)
 #define MOTIONCELLS_H_
 
 #include <opencv2/core.hpp>
-#ifdef HAVE_HIGHGUI_H
-#include <highgui.h>            // includes highGUI definitions
-#endif
-#ifdef HAVE_OPENCV2_HIGHGUI_HIGHGUI_C_H
-#include <opencv2/highgui.hpp>            // includes highGUI definitions
-#endif
+
 #include <fstream>
 #include <vector>
 #include <glib.h>
index c7193110595e5318e161f14a144e1ec650cbc26f..8fa0210e63f36520505d6e6cb266cc49b74671e0 100644 (file)
 #include <gst/opencv/gstopencvvideofilter.h>
 /* opencv */
 #include <opencv2/core.hpp>
-#ifdef HAVE_HIGHGUI_H
-#include <highgui.h>            // includes highGUI definitions
-#endif
-#ifdef HAVE_OPENCV2_HIGHGUI_HIGHGUI_C_H
-#include <opencv2/highgui.hpp>            // includes highGUI definitions
-#endif
 #include <opencv2/objdetect.hpp>
 
 G_BEGIN_DECLS
index c390d1883f9d8433fa8c575ceee6ebe9d2ffda99..8b4dcf925ece9c99750338e534ce1e340991e241 100644 (file)
@@ -64,6 +64,7 @@
 #include "../../gst-libs/gst/gst-i18n-plugin.h"
 #include "gsttemplatematch.h"
 #include <opencv2/imgproc.hpp>
+#include <opencv2/imgcodecs/imgcodecs_c.h>
 
 GST_DEBUG_CATEGORY_STATIC (gst_template_match_debug);
 #define GST_CAT_DEFAULT gst_template_match_debug
index a51ef9f6c609710eda51e4e4a58cd5b7732bd497..27a5432c5980338763d5975c4c347d2d1af2a075 100644 (file)
 
 #include <gst/opencv/gstopencvvideofilter.h>
 
-#ifdef HAVE_HIGHGUI_H
-#include <highgui.h>            // includes highGUI definitions
-#endif
-#ifdef HAVE_OPENCV2_HIGHGUI_HIGHGUI_C_H
-#include <opencv2/highgui.hpp>            // includes highGUI definitions
-#endif
-
 G_BEGIN_DECLS
 /* #defines don't like whitespacey bits */
 #define GST_TYPE_TEMPLATE_MATCH \
index 4627565547a7526dcb8b07c850df81630cba73d9..ff2fc98f2059d5249a55f48c241bbcaafa2fb6ec 100644 (file)
@@ -29,14 +29,14 @@ gstopencv_sources = [
 ]
 
 libopencv_headers = [
-  'opencv2/core/core_c.h',
-  'opencv2/core/version.hpp',
-  'opencv2/highgui/highgui_c.h',
-  'opencv2/imgproc/imgproc.hpp',
-  'opencv2/imgproc/imgproc_c.h',
-  'opencv2/objdetect/objdetect.hpp',
-  'opencv2/video/background_segm.hpp',
   'opencv2/bgsegm.hpp',
+  'opencv2/calib3d.hpp',
+  'opencv2/core.hpp',
+  'opencv2/imgcodecs/imgcodecs_c.h',
+  'opencv2/imgproc.hpp',
+  'opencv2/objdetect.hpp',
+  'opencv2/opencv.hpp',
+  'opencv2/video.hpp',
 ]
 
 gstopencv_cargs = ['-DGST_HAAR_CASCADES_DIR="@0@"']
index 5f1c430bec8b2b9a9682cf4c02d3097d855e4a28..b2042e4716aa68674e70ed910f98dd81930ec163 100644 (file)
@@ -77,14 +77,12 @@ cdata = configuration_data()
 check_headers = [
   ['HAVE_DLFCN_H', 'dlfcn.h'],
   ['HAVE_FCNTL_H', 'fcntl.h'],
-  ['HAVE_HIGHGUI_H', 'highgui.h'],
   ['HAVE_INTTYPES_H', 'inttypes.h'],
   ['HAVE_MEMORY_H', 'memory.h'],
   ['HAVE_MSACM_H', 'msacm.h'],
   ['HAVE_NETINET_IN_H', 'netinet/in.h'],
   ['HAVE_NETINET_IP_H', 'netinet/ip.h'],
   ['HAVE_NETINET_TCP_H', 'netinet/tcp.h'],
-  ['HAVE_OPENCV2_HIGHGUI_HIGHGUI_C_H', 'opencv2/highgui/highgui_c.h'],
   ['HAVE_PTHREAD_H', 'pthread.h'],
   ['HAVE_STDINT_H', 'stdint.h'],
   ['HAVE_STDLIB_H', 'stdlib.h'],