mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
handdetect: CvPoint values changed from uint to int
The x and y values of CvPoint changed from unsigned to signed integers in OpenCV 2.4.11. https://bugzilla.gnome.org/show_bug.cgi?id=752528
This commit is contained in:
parent
75e38f915f
commit
e00461a789
2 changed files with 36 additions and 36 deletions
|
@ -212,34 +212,34 @@ gst_handdetect_class_init (GstHanddetectClass * klass)
|
||||||
/* FIXME: property name needs fixing */
|
/* FIXME: property name needs fixing */
|
||||||
g_object_class_install_property (gobject_class,
|
g_object_class_install_property (gobject_class,
|
||||||
PROP_ROI_X,
|
PROP_ROI_X,
|
||||||
g_param_spec_uint ("ROI_X",
|
g_param_spec_int ("ROI_X",
|
||||||
"ROI_X",
|
"ROI_X",
|
||||||
"X of left-top pointer in region of interest \nGestures in the defined region of interest will emit messages",
|
"X of left-top pointer in region of interest \nGestures in the defined region of interest will emit messages",
|
||||||
0, UINT_MAX, 0, G_PARAM_READWRITE)
|
0, INT_MAX, 0, G_PARAM_READWRITE)
|
||||||
);
|
);
|
||||||
/* FIXME: property name needs fixing */
|
/* FIXME: property name needs fixing */
|
||||||
g_object_class_install_property (gobject_class,
|
g_object_class_install_property (gobject_class,
|
||||||
PROP_ROI_Y,
|
PROP_ROI_Y,
|
||||||
g_param_spec_uint ("ROI_Y",
|
g_param_spec_int ("ROI_Y",
|
||||||
"ROI_Y",
|
"ROI_Y",
|
||||||
"Y of left-top pointer in region of interest \nGestures in the defined region of interest will emit messages",
|
"Y of left-top pointer in region of interest \nGestures in the defined region of interest will emit messages",
|
||||||
0, UINT_MAX, 0, G_PARAM_READWRITE)
|
0, INT_MAX, 0, G_PARAM_READWRITE)
|
||||||
);
|
);
|
||||||
/* FIXME: property name needs fixing */
|
/* FIXME: property name needs fixing */
|
||||||
g_object_class_install_property (gobject_class,
|
g_object_class_install_property (gobject_class,
|
||||||
PROP_ROI_WIDTH,
|
PROP_ROI_WIDTH,
|
||||||
g_param_spec_uint ("ROI_WIDTH",
|
g_param_spec_int ("ROI_WIDTH",
|
||||||
"ROI_WIDTH",
|
"ROI_WIDTH",
|
||||||
"WIDTH of left-top pointer in region of interest \nGestures in the defined region of interest will emit messages",
|
"WIDTH of left-top pointer in region of interest \nGestures in the defined region of interest will emit messages",
|
||||||
0, UINT_MAX, 0, G_PARAM_READWRITE)
|
0, INT_MAX, 0, G_PARAM_READWRITE)
|
||||||
);
|
);
|
||||||
/* FIXME: property name needs fixing */
|
/* FIXME: property name needs fixing */
|
||||||
g_object_class_install_property (gobject_class,
|
g_object_class_install_property (gobject_class,
|
||||||
PROP_ROI_HEIGHT,
|
PROP_ROI_HEIGHT,
|
||||||
g_param_spec_uint ("ROI_HEIGHT",
|
g_param_spec_int ("ROI_HEIGHT",
|
||||||
"ROI_HEIGHT",
|
"ROI_HEIGHT",
|
||||||
"HEIGHT of left-top pointer in region of interest \nGestures in the defined region of interest will emit messages",
|
"HEIGHT of left-top pointer in region of interest \nGestures in the defined region of interest will emit messages",
|
||||||
0, UINT_MAX, 0, G_PARAM_READWRITE)
|
0, INT_MAX, 0, G_PARAM_READWRITE)
|
||||||
);
|
);
|
||||||
|
|
||||||
gst_element_class_set_static_metadata (element_class,
|
gst_element_class_set_static_metadata (element_class,
|
||||||
|
@ -316,16 +316,16 @@ gst_handdetect_set_property (GObject * object, guint prop_id,
|
||||||
filter->display = g_value_get_boolean (value);
|
filter->display = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
case PROP_ROI_X:
|
case PROP_ROI_X:
|
||||||
filter->roi_x = g_value_get_uint (value);
|
filter->roi_x = g_value_get_int (value);
|
||||||
break;
|
break;
|
||||||
case PROP_ROI_Y:
|
case PROP_ROI_Y:
|
||||||
filter->roi_y = g_value_get_uint (value);
|
filter->roi_y = g_value_get_int (value);
|
||||||
break;
|
break;
|
||||||
case PROP_ROI_WIDTH:
|
case PROP_ROI_WIDTH:
|
||||||
filter->roi_width = g_value_get_uint (value);
|
filter->roi_width = g_value_get_int (value);
|
||||||
break;
|
break;
|
||||||
case PROP_ROI_HEIGHT:
|
case PROP_ROI_HEIGHT:
|
||||||
filter->roi_height = g_value_get_uint (value);
|
filter->roi_height = g_value_get_int (value);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
@ -350,16 +350,16 @@ gst_handdetect_get_property (GObject * object, guint prop_id, GValue * value,
|
||||||
g_value_set_string (value, filter->profile_palm);
|
g_value_set_string (value, filter->profile_palm);
|
||||||
break;
|
break;
|
||||||
case PROP_ROI_X:
|
case PROP_ROI_X:
|
||||||
g_value_set_uint (value, filter->roi_x);
|
g_value_set_int (value, filter->roi_x);
|
||||||
break;
|
break;
|
||||||
case PROP_ROI_Y:
|
case PROP_ROI_Y:
|
||||||
g_value_set_uint (value, filter->roi_y);
|
g_value_set_int (value, filter->roi_y);
|
||||||
break;
|
break;
|
||||||
case PROP_ROI_WIDTH:
|
case PROP_ROI_WIDTH:
|
||||||
g_value_set_uint (value, filter->roi_width);
|
g_value_set_int (value, filter->roi_width);
|
||||||
break;
|
break;
|
||||||
case PROP_ROI_HEIGHT:
|
case PROP_ROI_HEIGHT:
|
||||||
g_value_set_uint (value, filter->roi_height);
|
g_value_set_int (value, filter->roi_height);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
@ -468,12 +468,12 @@ gst_handdetect_transform_ip (GstOpencvVideoFilter * transform,
|
||||||
/* Define structure for message post */
|
/* Define structure for message post */
|
||||||
s = gst_structure_new ("hand-gesture",
|
s = gst_structure_new ("hand-gesture",
|
||||||
"gesture", G_TYPE_STRING, "fist",
|
"gesture", G_TYPE_STRING, "fist",
|
||||||
"x", G_TYPE_UINT,
|
"x", G_TYPE_INT,
|
||||||
(guint) (filter->best_r->x + filter->best_r->width * 0.5), "y",
|
(gint) (filter->best_r->x + filter->best_r->width * 0.5), "y",
|
||||||
G_TYPE_UINT,
|
G_TYPE_INT,
|
||||||
(guint) (filter->best_r->y + filter->best_r->height * 0.5), "width",
|
(gint) (filter->best_r->y + filter->best_r->height * 0.5), "width",
|
||||||
G_TYPE_UINT, (guint) filter->best_r->width, "height", G_TYPE_UINT,
|
G_TYPE_INT, (gint) filter->best_r->width, "height", G_TYPE_INT,
|
||||||
(guint) filter->best_r->height, NULL);
|
(gint) filter->best_r->height, NULL);
|
||||||
/* Init message element */
|
/* Init message element */
|
||||||
m = gst_message_new_element (GST_OBJECT (filter), s);
|
m = gst_message_new_element (GST_OBJECT (filter), s);
|
||||||
/* Send message */
|
/* Send message */
|
||||||
|
@ -550,21 +550,21 @@ gst_handdetect_transform_ip (GstOpencvVideoFilter * transform,
|
||||||
/* send message:
|
/* send message:
|
||||||
* if the center point is in the region of interest, OR,
|
* if the center point is in the region of interest, OR,
|
||||||
* if the region of interest remains default as (0,0,0,0)*/
|
* if the region of interest remains default as (0,0,0,0)*/
|
||||||
if (((guint) c.x >= filter->roi_x
|
if (((gint) c.x >= filter->roi_x
|
||||||
&& (guint) c.x <= (filter->roi_x + filter->roi_width)
|
&& (gint) c.x <= (filter->roi_x + filter->roi_width)
|
||||||
&& (guint) c.y >= filter->roi_y
|
&& (gint) c.y >= filter->roi_y
|
||||||
&& (guint) c.y <= (filter->roi_y + filter->roi_height))
|
&& (gint) c.y <= (filter->roi_y + filter->roi_height))
|
||||||
|| (filter->roi_x == 0 && filter->roi_y == 0
|
|| (filter->roi_x == 0 && filter->roi_y == 0
|
||||||
&& filter->roi_width == 0 && filter->roi_height == 0)) {
|
&& filter->roi_width == 0 && filter->roi_height == 0)) {
|
||||||
/* Define structure for message post */
|
/* Define structure for message post */
|
||||||
s = gst_structure_new ("hand-gesture",
|
s = gst_structure_new ("hand-gesture",
|
||||||
"gesture", G_TYPE_STRING, "palm",
|
"gesture", G_TYPE_STRING, "palm",
|
||||||
"x", G_TYPE_UINT,
|
"x", G_TYPE_INT,
|
||||||
(guint) (filter->best_r->x + filter->best_r->width * 0.5), "y",
|
(gint) (filter->best_r->x + filter->best_r->width * 0.5), "y",
|
||||||
G_TYPE_UINT,
|
G_TYPE_INT,
|
||||||
(guint) (filter->best_r->y + filter->best_r->height * 0.5),
|
(gint) (filter->best_r->y + filter->best_r->height * 0.5),
|
||||||
"width", G_TYPE_UINT, (guint) filter->best_r->width, "height",
|
"width", G_TYPE_INT, (gint) filter->best_r->width, "height",
|
||||||
G_TYPE_UINT, (guint) filter->best_r->height, NULL);
|
G_TYPE_INT, (gint) filter->best_r->height, NULL);
|
||||||
/* Init message element */
|
/* Init message element */
|
||||||
m = gst_message_new_element (GST_OBJECT (filter), s);
|
m = gst_message_new_element (GST_OBJECT (filter), s);
|
||||||
/* Send message */
|
/* Send message */
|
||||||
|
|
|
@ -85,10 +85,10 @@ struct _GstHanddetect
|
||||||
gchar *profile_fist;
|
gchar *profile_fist;
|
||||||
gchar *profile_palm;
|
gchar *profile_palm;
|
||||||
/* region of interest */
|
/* region of interest */
|
||||||
guint roi_x;
|
gint roi_x;
|
||||||
guint roi_y;
|
gint roi_y;
|
||||||
guint roi_width;
|
gint roi_width;
|
||||||
guint roi_height;
|
gint roi_height;
|
||||||
|
|
||||||
/* opencv
|
/* opencv
|
||||||
* cvGray - image to gray colour
|
* cvGray - image to gray colour
|
||||||
|
|
Loading…
Reference in a new issue