opencv: Fixup include to follow new standard

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.
This commit is contained in:
Nicolas Dufresne 2018-08-02 11:19:07 -04:00
parent 9c91282ba6
commit d2ee9b16fa
7 changed files with 17 additions and 35 deletions

View 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

View file

@ -46,12 +46,7 @@
#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>

View file

@ -50,12 +50,6 @@
#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

View 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

View file

@ -48,13 +48,6 @@
#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 \

View 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@"']

View 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'],