opencv: skindetect: Ported to OpenCV version 3.1

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
This commit is contained in:
Vanessa Chipirras Navalon 2016-02-01 13:58:49 +01:00 committed by Luis de Bethencourt
parent b37c759e52
commit 4b60b47075

View 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) */