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:
Vanessa Chipirras Navalon 2016-01-27 15:51:37 +01:00 committed by Luis de Bethencourt
parent f91b71edde
commit 93b83edfe5

View file

@ -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,