diff options
author | Nicola Murino <nicola.murino@gmail.com> | 2018-11-25 20:27:25 +0100 |
---|---|---|
committer | Nicolas Dufresne <nicolas@ndufresne.ca> | 2018-11-26 13:29:03 +0000 |
commit | 24d5c9b200b84176d9c9bb4dc1b89fd92fd80185 (patch) | |
tree | 6dcb1eb3f99e67f9a6059a47732b090730f2f34d /ext/opencv | |
parent | b0773c6ea790862f014b468530a93cf89ae6f3d7 (diff) | |
download | gstreamer-plugins-bad-24d5c9b200b84176d9c9bb4dc1b89fd92fd80185.tar.gz |
opencv: define CASCADE_DO_CANNY_PRUNING for opencv < 4
Diffstat (limited to 'ext/opencv')
-rw-r--r-- | ext/opencv/gsthanddetect.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ext/opencv/gsthanddetect.cpp b/ext/opencv/gsthanddetect.cpp index d5b7ebbf4..2bfe68a25 100644 --- a/ext/opencv/gsthanddetect.cpp +++ b/ext/opencv/gsthanddetect.cpp @@ -69,6 +69,9 @@ GST_DEBUG_CATEGORY_STATIC (gst_handdetect_debug); #define GST_CAT_DEFAULT gst_handdetect_debug +#if (CV_MAJOR_VERSION < 4) +#define CASCADE_DO_CANNY_PRUNING CV_HAAR_DO_CANNY_PRUNING +#endif /* define HAAR files */ #define HAAR_FILE_FIST GST_HAAR_CASCADES_DIR G_DIR_SEPARATOR_S "fist.xml" @@ -413,13 +416,8 @@ gst_handdetect_transform_ip (GstOpencvVideoFilter * transform, Mat roi (image, Rect (filter->cvGray->origin, filter->cvGray->origin, filter->cvGray->width, filter->cvGray->height)); -#if (CV_MAJOR_VERSION >= 4) filter->cvCascade_fist->detectMultiScale (roi, hands, 1.1, 2, CASCADE_DO_CANNY_PRUNING, cvSize (24, 24), cvSize (0, 0)); -#else - filter->cvCascade_fist->detectMultiScale (roi, hands, 1.1, 2, - CV_HAAR_DO_CANNY_PRUNING, cvSize (24, 24), cvSize (0, 0)); -#endif /* if FIST gesture detected */ if (!hands.empty ()) { |