facedetect: don't skip faces
Skipping faces at this point makes us lie about the num-ber of faces and also causes leaks.
This commit is contained in:
parent
e6c9b60851
commit
3d7c8aad70
@ -514,8 +514,6 @@ gst_face_detect_transform_ip (GstOpencvVideoFilter * base, GstBuffer * buf,
|
|||||||
|
|
||||||
for (i = 0; i < (faces ? faces->total : 0); i++) {
|
for (i = 0; i < (faces ? faces->total : 0); i++) {
|
||||||
CvRect *r = (CvRect *) cvGetSeqElem (faces, i);
|
CvRect *r = (CvRect *) cvGetSeqElem (faces, i);
|
||||||
GValue value = { 0 };
|
|
||||||
GstStructure *s;
|
|
||||||
guint mw = filter->min_size_width / 8;
|
guint mw = filter->min_size_width / 8;
|
||||||
guint mh = filter->min_size_height / 8;
|
guint mh = filter->min_size_height / 8;
|
||||||
guint rnx, rny, rnw, rnh;
|
guint rnx, rny, rnw, rnh;
|
||||||
@ -578,9 +576,9 @@ gst_face_detect_transform_ip (GstOpencvVideoFilter * base, GstBuffer * buf,
|
|||||||
i, faces->total, r->x, r->y, r->width, r->height,
|
i, faces->total, r->x, r->y, r->width, r->height,
|
||||||
have_eyes, have_nose, have_mouth);
|
have_eyes, have_nose, have_mouth);
|
||||||
|
|
||||||
/* ignore 'face' where we don't fix mount/nose/eyes ? */
|
if (msg) {
|
||||||
if (!(have_eyes && have_nose && have_mouth))
|
GValue value = { 0 };
|
||||||
continue;
|
GstStructure *s;
|
||||||
|
|
||||||
s = gst_structure_new ("face",
|
s = gst_structure_new ("face",
|
||||||
"x", G_TYPE_UINT, r->x,
|
"x", G_TYPE_UINT, r->x,
|
||||||
@ -622,6 +620,7 @@ gst_face_detect_transform_ip (GstOpencvVideoFilter * base, GstBuffer * buf,
|
|||||||
gst_value_set_structure (&value, s);
|
gst_value_set_structure (&value, s);
|
||||||
gst_value_list_append_value (&facelist, &value);
|
gst_value_list_append_value (&facelist, &value);
|
||||||
g_value_unset (&value);
|
g_value_unset (&value);
|
||||||
|
}
|
||||||
|
|
||||||
if (do_display) {
|
if (do_display) {
|
||||||
CvPoint center;
|
CvPoint center;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user