mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
opencv: Bump requirement to 3.0.0+
And removes all the ifdef code to support the 2.X APIs.
This commit is contained in:
parent
f028f817e3
commit
cabf875098
14 changed files with 29 additions and 142 deletions
11
configure.ac
11
configure.ac
|
@ -1885,7 +1885,7 @@ AG_GST_CHECK_FEATURE(OPENCV, [opencv plugins], opencv, [
|
||||||
dnl a new version and the no-backward-compatibility define. (There doesn't
|
dnl a new version and the no-backward-compatibility define. (There doesn't
|
||||||
dnl seem to be a switch to suppress the warnings the cvcompat.h header
|
dnl seem to be a switch to suppress the warnings the cvcompat.h header
|
||||||
dnl causes.)
|
dnl causes.)
|
||||||
PKG_CHECK_MODULES(OPENCV, opencv >= 2.3.0 opencv < 3.5.0 , [
|
PKG_CHECK_MODULES(OPENCV, opencv >= 3.0.0 opencv < 3.5.0 , [
|
||||||
AC_PROG_CXX
|
AC_PROG_CXX
|
||||||
AC_LANG([C++])
|
AC_LANG([C++])
|
||||||
OLD_CPPFLAGS=$CPPFLAGS
|
OLD_CPPFLAGS=$CPPFLAGS
|
||||||
|
@ -1897,13 +1897,8 @@ AG_GST_CHECK_FEATURE(OPENCV, [opencv plugins], opencv, [
|
||||||
opencv2/imgproc/imgproc.hpp \
|
opencv2/imgproc/imgproc.hpp \
|
||||||
opencv2/imgproc/imgproc_c.h \
|
opencv2/imgproc/imgproc_c.h \
|
||||||
opencv2/objdetect/objdetect.hpp \
|
opencv2/objdetect/objdetect.hpp \
|
||||||
opencv2/video/background_segm.hpp], [], [something_not_found=yes])
|
opencv2/video/background_segm.hpp \
|
||||||
|
opencv2/bgsegm.hpp], [], [something_not_found=yes])
|
||||||
dnl Only required for OpenCV >= 3, we have compat code for older versions
|
|
||||||
PKG_CHECK_MODULES(OPENCV_3, opencv >= 3, [
|
|
||||||
dnl check opencv_contrib headers (not always present in opencv distributions)
|
|
||||||
AC_CHECK_HEADERS([opencv2/bgsegm.hpp], [], [something_not_found=yes])],
|
|
||||||
[NOT_A_PROBLEM=yes])
|
|
||||||
|
|
||||||
CPPFLAGS=$OLD_CPPFLAGS
|
CPPFLAGS=$OLD_CPPFLAGS
|
||||||
AC_LANG([C])
|
AC_LANG([C])
|
||||||
|
|
|
@ -42,19 +42,13 @@
|
||||||
* Boston, MA 02110-1301, USA.
|
* Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* This breaks the build for reasons that aren't entirely clear to me yet */
|
#ifdef HAVE_CONFIG_H
|
||||||
#if 0
|
#include "config.h"
|
||||||
//#ifdef HAVE_CONFIG_H
|
|
||||||
//#include "config.h"
|
|
||||||
//#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include "MotionCells.h"
|
#include "MotionCells.h"
|
||||||
#if (CV_MAJOR_VERSION >= 3)
|
|
||||||
#include <opencv2/imgproc.hpp>
|
#include <opencv2/imgproc.hpp>
|
||||||
#endif
|
|
||||||
#include <opencv2/imgproc/imgproc_c.h>
|
|
||||||
|
|
||||||
MotionCells::MotionCells ()
|
MotionCells::MotionCells ()
|
||||||
{
|
{
|
||||||
|
|
|
@ -84,9 +84,7 @@
|
||||||
|
|
||||||
#include "gstcameracalibrate.h"
|
#include "gstcameracalibrate.h"
|
||||||
|
|
||||||
#if (CV_MAJOR_VERSION >= 3)
|
|
||||||
#include <opencv2/imgproc.hpp>
|
#include <opencv2/imgproc.hpp>
|
||||||
#endif
|
|
||||||
#include <opencv2/calib3d.hpp>
|
#include <opencv2/calib3d.hpp>
|
||||||
|
|
||||||
#include <gst/opencv/gstopencvutils.h>
|
#include <gst/opencv/gstopencvutils.h>
|
||||||
|
|
|
@ -77,9 +77,7 @@
|
||||||
|
|
||||||
#include "gstcameraundistort.h"
|
#include "gstcameraundistort.h"
|
||||||
|
|
||||||
#if (CV_MAJOR_VERSION >= 3)
|
|
||||||
#include <opencv2/imgproc.hpp>
|
#include <opencv2/imgproc.hpp>
|
||||||
#endif
|
|
||||||
#include <opencv2/calib3d.hpp>
|
#include <opencv2/calib3d.hpp>
|
||||||
|
|
||||||
#include <gst/opencv/gstopencvutils.h>
|
#include <gst/opencv/gstopencvutils.h>
|
||||||
|
|
|
@ -120,10 +120,7 @@ gst-launch-1.0 multifilesrc location=~/im3.png ! pngdec ! videoconvert ! di
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "gstdisparity.h"
|
#include "gstdisparity.h"
|
||||||
#include <opencv2/imgproc/imgproc_c.h>
|
|
||||||
#if (CV_MAJOR_VERSION >= 3)
|
|
||||||
#include <opencv2/imgproc.hpp>
|
#include <opencv2/imgproc.hpp>
|
||||||
#endif
|
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_STATIC (gst_disparity_debug);
|
GST_DEBUG_CATEGORY_STATIC (gst_disparity_debug);
|
||||||
#define GST_CAT_DEFAULT gst_disparity_debug
|
#define GST_CAT_DEFAULT gst_disparity_debug
|
||||||
|
@ -646,7 +643,7 @@ initialise_sbm (GstDisparity * filter)
|
||||||
(void *) new Mat (cvarrToMat (filter->cvGray_left, false));
|
(void *) new Mat (cvarrToMat (filter->cvGray_left, false));
|
||||||
filter->depth_map_as_cvMat =
|
filter->depth_map_as_cvMat =
|
||||||
(void *) new Mat (cvarrToMat (filter->cvGray_depth_map1, false));
|
(void *) new Mat (cvarrToMat (filter->cvGray_depth_map1, false));
|
||||||
#if (CV_MAJOR_VERSION >= 3)
|
|
||||||
filter->sbm = StereoBM::create();
|
filter->sbm = StereoBM::create();
|
||||||
filter->sgbm = StereoSGBM::create(1,64,3);
|
filter->sgbm = StereoSGBM::create(1,64,3);
|
||||||
|
|
||||||
|
@ -672,33 +669,6 @@ initialise_sbm (GstDisparity * filter)
|
||||||
filter->sgbm->setSpeckleWindowSize (0);
|
filter->sgbm->setSpeckleWindowSize (0);
|
||||||
filter->sgbm->setSpeckleRange (0);
|
filter->sgbm->setSpeckleRange (0);
|
||||||
filter->sgbm->setMode (StereoSGBM::MODE_HH);
|
filter->sgbm->setMode (StereoSGBM::MODE_HH);
|
||||||
#else
|
|
||||||
filter->sbm = (void *) new StereoBM ();
|
|
||||||
filter->sgbm = (void *) new StereoSGBM ();
|
|
||||||
|
|
||||||
((StereoBM *) filter->sbm)->state->SADWindowSize = 9;
|
|
||||||
((StereoBM *) filter->sbm)->state->numberOfDisparities = 32;
|
|
||||||
((StereoBM *) filter->sbm)->state->preFilterSize = 9;
|
|
||||||
((StereoBM *) filter->sbm)->state->preFilterCap = 32;
|
|
||||||
((StereoBM *) filter->sbm)->state->minDisparity = 0;
|
|
||||||
((StereoBM *) filter->sbm)->state->textureThreshold = 0;
|
|
||||||
((StereoBM *) filter->sbm)->state->uniquenessRatio = 0;
|
|
||||||
((StereoBM *) filter->sbm)->state->speckleWindowSize = 0;
|
|
||||||
((StereoBM *) filter->sbm)->state->speckleRange = 0;
|
|
||||||
((StereoBM *) filter->sbm)->state->disp12MaxDiff = 0;
|
|
||||||
|
|
||||||
((StereoSGBM *) filter->sgbm)->minDisparity = 1;
|
|
||||||
((StereoSGBM *) filter->sgbm)->numberOfDisparities = 64;
|
|
||||||
((StereoSGBM *) filter->sgbm)->SADWindowSize = 3;
|
|
||||||
((StereoSGBM *) filter->sgbm)->P1 = 200;;
|
|
||||||
((StereoSGBM *) filter->sgbm)->P2 = 255;
|
|
||||||
((StereoSGBM *) filter->sgbm)->disp12MaxDiff = 0;
|
|
||||||
((StereoSGBM *) filter->sgbm)->preFilterCap = 0;
|
|
||||||
((StereoSGBM *) filter->sgbm)->uniquenessRatio = 0;
|
|
||||||
((StereoSGBM *) filter->sgbm)->speckleWindowSize = 0;
|
|
||||||
((StereoSGBM *) filter->sgbm)->speckleRange = 0;
|
|
||||||
((StereoSGBM *) filter->sgbm)->fullDP = true;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@ -706,34 +676,22 @@ initialise_sbm (GstDisparity * filter)
|
||||||
int
|
int
|
||||||
run_sbm_iteration (GstDisparity * filter)
|
run_sbm_iteration (GstDisparity * filter)
|
||||||
{
|
{
|
||||||
#if (CV_MAJOR_VERSION >= 3)
|
|
||||||
((StereoBM *) filter->
|
((StereoBM *) filter->
|
||||||
sbm)->compute (*((Mat *) filter->img_left_as_cvMat_gray),
|
sbm)->compute (*((Mat *) filter->img_left_as_cvMat_gray),
|
||||||
*((Mat *) filter->img_right_as_cvMat_gray),
|
*((Mat *) filter->img_right_as_cvMat_gray),
|
||||||
*((Mat *) filter->depth_map_as_cvMat));
|
*((Mat *) filter->depth_map_as_cvMat));
|
||||||
#else
|
|
||||||
(*((StereoBM *) filter->
|
|
||||||
sbm)) (*((Mat *) filter->img_left_as_cvMat_gray),
|
|
||||||
*((Mat *) filter->img_right_as_cvMat_gray),
|
|
||||||
*((Mat *) filter->depth_map_as_cvMat));
|
|
||||||
#endif
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
run_sgbm_iteration (GstDisparity * filter)
|
run_sgbm_iteration (GstDisparity * filter)
|
||||||
{
|
{
|
||||||
#if (CV_MAJOR_VERSION >= 3)
|
|
||||||
((StereoSGBM *) filter->
|
((StereoSGBM *) filter->
|
||||||
sgbm)->compute (*((Mat *) filter->img_left_as_cvMat_gray),
|
sgbm)->compute (*((Mat *) filter->img_left_as_cvMat_gray),
|
||||||
*((Mat *) filter->img_right_as_cvMat_gray),
|
*((Mat *) filter->img_right_as_cvMat_gray),
|
||||||
*((Mat *) filter->depth_map_as_cvMat));
|
*((Mat *) filter->depth_map_as_cvMat));
|
||||||
#else
|
|
||||||
(*((StereoSGBM *) filter->
|
|
||||||
sgbm)) (*((Mat *) filter->img_left_as_cvMat_gray),
|
|
||||||
*((Mat *) filter->img_right_as_cvMat_gray),
|
|
||||||
*((Mat *) filter->depth_map_as_cvMat));
|
|
||||||
#endif
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -743,12 +701,9 @@ finalise_sbm (GstDisparity * filter)
|
||||||
delete (Mat *) filter->depth_map_as_cvMat;
|
delete (Mat *) filter->depth_map_as_cvMat;
|
||||||
delete (Mat *) filter->img_left_as_cvMat_gray;
|
delete (Mat *) filter->img_left_as_cvMat_gray;
|
||||||
delete (Mat *) filter->img_right_as_cvMat_gray;
|
delete (Mat *) filter->img_right_as_cvMat_gray;
|
||||||
#if (CV_MAJOR_VERSION >= 3)
|
|
||||||
filter->sbm.release();
|
filter->sbm.release();
|
||||||
filter->sgbm.release();
|
filter->sgbm.release();
|
||||||
#else
|
|
||||||
delete (StereoBM *) filter->sbm;
|
|
||||||
delete (StereoSGBM *) filter->sgbm;
|
|
||||||
#endif
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,9 +47,8 @@
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/video/video.h>
|
#include <gst/video/video.h>
|
||||||
|
|
||||||
#include <opencv2/core/core.hpp>
|
#include <opencv2/core.hpp>
|
||||||
#include <opencv2/calib3d/calib3d.hpp>
|
#include <opencv2/calib3d.hpp>
|
||||||
#include <opencv2/core/version.hpp>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
/* #defines don't like whitespacey bits */
|
/* #defines don't like whitespacey bits */
|
||||||
|
@ -97,13 +96,9 @@ struct _GstDisparity
|
||||||
void *img_right_as_cvMat_gray; /* cv::Mat */
|
void *img_right_as_cvMat_gray; /* cv::Mat */
|
||||||
void *img_left_as_cvMat_gray; /* cv::Mat */
|
void *img_left_as_cvMat_gray; /* cv::Mat */
|
||||||
void *depth_map_as_cvMat; /* cv::Mat */
|
void *depth_map_as_cvMat; /* cv::Mat */
|
||||||
#if (CV_MAJOR_VERSION >= 3)
|
|
||||||
cv::Ptr<cv::StereoBM> sbm; /* cv::StereoBM */
|
cv::Ptr<cv::StereoBM> sbm; /* cv::StereoBM */
|
||||||
cv::Ptr<cv::StereoSGBM> sgbm; /* cv::StereoSGBM */
|
cv::Ptr<cv::StereoSGBM> sgbm; /* cv::StereoSGBM */
|
||||||
#else
|
|
||||||
void *sbm; /* cv::StereoBM */
|
|
||||||
void *sgbm; /* cv::StereoSGBM */
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstDisparityClass
|
struct _GstDisparityClass
|
||||||
|
|
|
@ -81,9 +81,7 @@
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#include "gstfacedetect.h"
|
#include "gstfacedetect.h"
|
||||||
#if (CV_MAJOR_VERSION >= 3)
|
|
||||||
#include <opencv2/imgproc.hpp>
|
#include <opencv2/imgproc.hpp>
|
||||||
#endif
|
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_STATIC (gst_face_detect_debug);
|
GST_DEBUG_CATEGORY_STATIC (gst_face_detect_debug);
|
||||||
#define GST_CAT_DEFAULT gst_face_detect_debug
|
#define GST_CAT_DEFAULT gst_face_detect_debug
|
||||||
|
|
|
@ -62,10 +62,7 @@
|
||||||
|
|
||||||
/* element header */
|
/* element header */
|
||||||
#include "gsthanddetect.h"
|
#include "gsthanddetect.h"
|
||||||
#if (CV_MAJOR_VERSION >= 3)
|
|
||||||
#include <opencv2/imgproc.hpp>
|
#include <opencv2/imgproc.hpp>
|
||||||
#endif
|
|
||||||
#include <opencv2/imgproc/imgproc_c.h>
|
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_STATIC (gst_handdetect_debug);
|
GST_DEBUG_CATEGORY_STATIC (gst_handdetect_debug);
|
||||||
#define GST_CAT_DEFAULT gst_handdetect_debug
|
#define GST_CAT_DEFAULT gst_handdetect_debug
|
||||||
|
|
|
@ -97,9 +97,8 @@ GST_DEBUG_CATEGORY_STATIC (gst_segmentation_debug);
|
||||||
#define GST_CAT_DEFAULT gst_segmentation_debug
|
#define GST_CAT_DEFAULT gst_segmentation_debug
|
||||||
|
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
#if (CV_MAJOR_VERSION >= 3)
|
using namespace cv::bgsegm;
|
||||||
using namespace cv::bgsegm;
|
|
||||||
#endif
|
|
||||||
/* Filter signals and args */
|
/* Filter signals and args */
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
@ -776,13 +775,8 @@ initialise_mog (GstSegmentation * filter)
|
||||||
filter->img_input_as_cvMat = (void *) new Mat (cvarrToMat (filter->cvYUV, false));
|
filter->img_input_as_cvMat = (void *) new Mat (cvarrToMat (filter->cvYUV, false));
|
||||||
filter->img_fg_as_cvMat = (void *) new Mat (cvarrToMat(filter->cvFG, false));
|
filter->img_fg_as_cvMat = (void *) new Mat (cvarrToMat(filter->cvFG, false));
|
||||||
|
|
||||||
#if (CV_MAJOR_VERSION >= 3)
|
|
||||||
filter->mog = bgsegm::createBackgroundSubtractorMOG ();
|
filter->mog = bgsegm::createBackgroundSubtractorMOG ();
|
||||||
filter->mog2 = createBackgroundSubtractorMOG2 ();
|
filter->mog2 = createBackgroundSubtractorMOG2 ();
|
||||||
#else
|
|
||||||
filter->mog = (void *) new BackgroundSubtractorMOG ();
|
|
||||||
filter->mog2 = (void *) new BackgroundSubtractorMOG2 ();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@ -805,15 +799,9 @@ run_mog_iteration (GstSegmentation * filter)
|
||||||
European Workshop on Advanced Video-Based Surveillance Systems, 2001
|
European Workshop on Advanced Video-Based Surveillance Systems, 2001
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if (CV_MAJOR_VERSION >= 3)
|
|
||||||
filter->mog->apply (*((Mat *) filter->
|
filter->mog->apply (*((Mat *) filter->
|
||||||
img_input_as_cvMat), *((Mat *) filter->img_fg_as_cvMat),
|
img_input_as_cvMat), *((Mat *) filter->img_fg_as_cvMat),
|
||||||
filter->learning_rate);
|
filter->learning_rate);
|
||||||
#else
|
|
||||||
(*((BackgroundSubtractorMOG *) filter->mog)) (*((Mat *) filter->
|
|
||||||
img_input_as_cvMat), *((Mat *) filter->img_fg_as_cvMat),
|
|
||||||
filter->learning_rate);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@ -839,15 +827,9 @@ run_mog2_iteration (GstSegmentation * filter)
|
||||||
Letters, vol. 27, no. 7, pages 773-780, 2006.
|
Letters, vol. 27, no. 7, pages 773-780, 2006.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if (CV_MAJOR_VERSION >= 3)
|
|
||||||
filter->mog2->apply (*((Mat *) filter->
|
filter->mog2->apply (*((Mat *) filter->
|
||||||
img_input_as_cvMat), *((Mat *) filter->img_fg_as_cvMat),
|
img_input_as_cvMat), *((Mat *) filter->img_fg_as_cvMat),
|
||||||
filter->learning_rate);
|
filter->learning_rate);
|
||||||
#else
|
|
||||||
(*((BackgroundSubtractorMOG *) filter->mog2)) (*((Mat *) filter->
|
|
||||||
img_input_as_cvMat), *((Mat *) filter->img_fg_as_cvMat),
|
|
||||||
filter->learning_rate);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@ -857,12 +839,9 @@ finalise_mog (GstSegmentation * filter)
|
||||||
{
|
{
|
||||||
delete (Mat *) filter->img_input_as_cvMat;
|
delete (Mat *) filter->img_input_as_cvMat;
|
||||||
delete (Mat *) filter->img_fg_as_cvMat;
|
delete (Mat *) filter->img_fg_as_cvMat;
|
||||||
#if (CV_MAJOR_VERSION >= 3)
|
|
||||||
filter->mog.release ();
|
filter->mog.release ();
|
||||||
filter->mog2.release ();
|
filter->mog2.release ();
|
||||||
#else
|
|
||||||
delete (BackgroundSubtractorMOG *) filter->mog;
|
|
||||||
delete (BackgroundSubtractorMOG2 *) filter->mog2;
|
|
||||||
#endif
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,12 +46,10 @@
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/opencv/gstopencvvideofilter.h>
|
#include <gst/opencv/gstopencvvideofilter.h>
|
||||||
#include <opencv2/core/core_c.h>
|
|
||||||
#include <opencv2/video/background_segm.hpp>
|
#include <opencv2/video.hpp>
|
||||||
#include <opencv2/core/version.hpp>
|
#include <opencv2/core.hpp>
|
||||||
#if (CV_MAJOR_VERSION >= 3)
|
#include <opencv2/bgsegm.hpp>
|
||||||
#include <opencv2/bgsegm.hpp>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
@ -110,13 +108,9 @@ struct _GstSegmentation
|
||||||
CvSeq *contours;
|
CvSeq *contours;
|
||||||
|
|
||||||
/* for MOG methods */
|
/* for MOG methods */
|
||||||
#if (CV_MAJOR_VERSION >= 3)
|
|
||||||
cv::Ptr<cv::BackgroundSubtractor> mog; /* cv::BackgroundSubtractorMOG */
|
cv::Ptr<cv::BackgroundSubtractor> mog; /* cv::BackgroundSubtractorMOG */
|
||||||
cv::Ptr<cv::BackgroundSubtractorMOG2> mog2; /* cv::BackgroundSubtractorMOG2 */
|
cv::Ptr<cv::BackgroundSubtractorMOG2> mog2; /* cv::BackgroundSubtractorMOG2 */
|
||||||
#else
|
|
||||||
void *mog; /* cv::BackgroundSubtractorMOG */
|
|
||||||
void *mog2; /* cv::BackgroundSubtractorMOG2 */
|
|
||||||
#endif
|
|
||||||
void *img_input_as_cvMat; /* cv::Mat */
|
void *img_input_as_cvMat; /* cv::Mat */
|
||||||
void *img_fg_as_cvMat; /* cv::Mat */
|
void *img_fg_as_cvMat; /* cv::Mat */
|
||||||
double learning_rate;
|
double learning_rate;
|
||||||
|
|
|
@ -63,10 +63,7 @@
|
||||||
|
|
||||||
#include "../../gst-libs/gst/gst-i18n-plugin.h"
|
#include "../../gst-libs/gst/gst-i18n-plugin.h"
|
||||||
#include "gsttemplatematch.h"
|
#include "gsttemplatematch.h"
|
||||||
#if (CV_MAJOR_VERSION >= 3)
|
|
||||||
#include <opencv2/imgproc.hpp>
|
#include <opencv2/imgproc.hpp>
|
||||||
#endif
|
|
||||||
#include <opencv2/imgproc/imgproc_c.h>
|
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_STATIC (gst_template_match_debug);
|
GST_DEBUG_CATEGORY_STATIC (gst_template_match_debug);
|
||||||
#define GST_CAT_DEFAULT gst_template_match_debug
|
#define GST_CAT_DEFAULT gst_template_match_debug
|
||||||
|
|
|
@ -47,10 +47,9 @@
|
||||||
#define __GST_OPENCV_TEXT_OVERLAY_H__
|
#define __GST_OPENCV_TEXT_OVERLAY_H__
|
||||||
|
|
||||||
#include <gst/opencv/gstopencvvideofilter.h>
|
#include <gst/opencv/gstopencvvideofilter.h>
|
||||||
#include <opencv2/core/core_c.h>
|
#include <opencv2/core.hpp>
|
||||||
#if (CV_MAJOR_VERSION >= 3)
|
#include <opencv2/imgproc.hpp>
|
||||||
#include <opencv2/imgproc/imgproc_c.h>
|
|
||||||
#endif
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
/* #defines don't like whitespacey bits */
|
/* #defines don't like whitespacey bits */
|
||||||
|
|
|
@ -28,7 +28,7 @@ gstopencv_sources = [
|
||||||
'gstcameraundistort.cpp'
|
'gstcameraundistort.cpp'
|
||||||
]
|
]
|
||||||
|
|
||||||
libopencv2_headers = [
|
libopencv_headers = [
|
||||||
'opencv2/core/core_c.h',
|
'opencv2/core/core_c.h',
|
||||||
'opencv2/core/version.hpp',
|
'opencv2/core/version.hpp',
|
||||||
'opencv2/highgui/highgui_c.h',
|
'opencv2/highgui/highgui_c.h',
|
||||||
|
@ -36,33 +36,21 @@ libopencv2_headers = [
|
||||||
'opencv2/imgproc/imgproc_c.h',
|
'opencv2/imgproc/imgproc_c.h',
|
||||||
'opencv2/objdetect/objdetect.hpp',
|
'opencv2/objdetect/objdetect.hpp',
|
||||||
'opencv2/video/background_segm.hpp',
|
'opencv2/video/background_segm.hpp',
|
||||||
]
|
|
||||||
|
|
||||||
libopencv3_headers = [
|
|
||||||
'opencv2/bgsegm.hpp',
|
'opencv2/bgsegm.hpp',
|
||||||
]
|
]
|
||||||
|
|
||||||
gstopencv_cargs = ['-DGST_HAAR_CASCADES_DIR="@0@"']
|
gstopencv_cargs = ['-DGST_HAAR_CASCADES_DIR="@0@"']
|
||||||
|
|
||||||
opencv_dep = dependency('opencv', version : ['>= 2.3.0', '< 3.5.0'], required : false)
|
opencv_dep = dependency('opencv', version : ['>= 3.0.0', '< 3.5.0'], required : false)
|
||||||
opencv_found = opencv_dep.found()
|
opencv_found = opencv_dep.found()
|
||||||
|
|
||||||
if opencv_found
|
if opencv_found
|
||||||
foreach h : libopencv2_headers
|
foreach h : libopencv_headers
|
||||||
if not cxx.has_header(h)
|
if not cxx.has_header(h)
|
||||||
message('Needed header "' + h + '" not found')
|
message('Needed header "' + h + '" not found')
|
||||||
opencv_found = false
|
opencv_found = false
|
||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
if opencv_dep.version() >= '3.0.0'
|
|
||||||
foreach h : libopencv3_headers
|
|
||||||
if not cxx.has_header(h)
|
|
||||||
message('Needed header "' + h + '" not found')
|
|
||||||
opencv_found = false
|
|
||||||
endif
|
|
||||||
endforeach
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if opencv_found
|
if opencv_found
|
||||||
|
|
|
@ -9,7 +9,7 @@ opencv_headers = [
|
||||||
'gstopencvvideofilter.h',
|
'gstopencvvideofilter.h',
|
||||||
]
|
]
|
||||||
|
|
||||||
opencv_dep = dependency('opencv', version : '>= 2.3.0', required : get_option('opencv'))
|
opencv_dep = dependency('opencv', version : '>= 3.0.0', required : get_option('opencv'))
|
||||||
if opencv_dep.found()
|
if opencv_dep.found()
|
||||||
gstopencv = library('gstopencv-' + api_version,
|
gstopencv = library('gstopencv-' + api_version,
|
||||||
opencv_sources,
|
opencv_sources,
|
||||||
|
|
Loading…
Reference in a new issue