mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
opencv: handdetect: Ported to OpenCV version 3.1
cvarrToMat() is added because it is compatible with all versions of Opencv and the use of the class constructor Mat is eliminated because is deprecated in 3.X versions. Included 'using namespace std' because it is needed for the vector class in 3.X versions. This keeps compatibility with 2.4. https://bugzilla.gnome.org/show_bug.cgi?id=760473
This commit is contained in:
parent
f91b71edde
commit
93b83edfe5
1 changed files with 3 additions and 1 deletions
|
@ -72,6 +72,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_handdetect_debug);
|
|||
#define HAAR_FILE_PALM GST_HAAR_CASCADES_DIR G_DIR_SEPARATOR_S "palm.xml"
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
/* Filter signals and args */
|
||||
enum
|
||||
{
|
||||
|
@ -405,7 +406,8 @@ gst_handdetect_transform_ip (GstOpencvVideoFilter * transform,
|
|||
cvCvtColor (img, filter->cvGray, CV_RGB2GRAY);
|
||||
|
||||
/* detect FIST gesture fist */
|
||||
Mat roi (filter->cvGray, Rect (filter->cvGray->origin,
|
||||
Mat image = cvarrToMat(filter->cvGray);
|
||||
Mat roi (image, Rect (filter->cvGray->origin,
|
||||
filter->cvGray->origin, filter->cvGray->width,
|
||||
filter->cvGray->height));
|
||||
filter->cvCascade_fist->detectMultiScale (roi, hands, 1.1, 2,
|
||||
|
|
Loading…
Reference in a new issue