opencv: skindetect: Ported to OpenCV version 3.1
authorVanessa Chipirras Navalon <vanechipi@qtec.com>
Mon, 1 Feb 2016 12:58:49 +0000 (13:58 +0100)
committerLuis de Bethencourt <luisbg@osg.samsung.com>
Wed, 30 Mar 2016 21:11:49 +0000 (22:11 +0100)
cvCVPixToPlane() has been deprecated in OpenCV 3.0, and there is
function to replace it cvSplit(). The include compat.hpp is deleted because
in 3.X versions doen't exist and it isn't necessary for 2.4.X versions
in this element. This keeps compatibility with 2.4.

https://bugzilla.gnome.org/show_bug.cgi?id=760473

ext/opencv/gstskindetect.cpp

index ad81a38..e2fcb59 100644 (file)
@@ -60,7 +60,6 @@
 
 #include "gstskindetect.h"
 #include <opencv2/imgproc/imgproc_c.h>
-#include <opencv2/legacy/compat.hpp>
 
 GST_DEBUG_CATEGORY_STATIC (gst_skin_detect_debug);
 #define GST_CAT_DEFAULT gst_skin_detect_debug
@@ -339,7 +338,7 @@ gst_skin_detect_transform (GstOpencvVideoFilter * base, GstBuffer * buf,
 
     cvCvtColor (filter->cvSkinPixels1, filter->cvRGB, CV_GRAY2RGB);
   } else if (RGB == filter->method) {
-    cvCvtPixToPlane (filter->cvRGB, filter->cvR, filter->cvG, filter->cvB, 0);  /*  Extract the 3 color components. */
+    cvSplit (filter->cvRGB, filter->cvR, filter->cvG, filter->cvB, 0);  /*  Extract the 3 color components. */
     cvAdd (filter->cvR, filter->cvG, filter->cvAll, NULL);
     cvAdd (filter->cvB, filter->cvAll, filter->cvAll, NULL);    /*  All = R + G + B */
     cvDiv (filter->cvR, filter->cvAll, filter->cvRp, 1.0);      /*  R' = R / ( R + G + B) */