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:
Stefan Sauer 2012-03-15 22:22:12 +01:00
parent e6c9b60851
commit 3d7c8aad70

View File

@ -514,8 +514,6 @@ gst_face_detect_transform_ip (GstOpencvVideoFilter * base, GstBuffer * buf,
for (i = 0; i < (faces ? faces->total : 0); i++) {
CvRect *r = (CvRect *) cvGetSeqElem (faces, i);
GValue value = { 0 };
GstStructure *s;
guint mw = filter->min_size_width / 8;
guint mh = filter->min_size_height / 8;
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,
have_eyes, have_nose, have_mouth);
/* ignore 'face' where we don't fix mount/nose/eyes ? */
if (!(have_eyes && have_nose && have_mouth))
continue;
if (msg) {
GValue value = { 0 };
GstStructure *s;
s = gst_structure_new ("face",
"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_list_append_value (&facelist, &value);
g_value_unset (&value);
}
if (do_display) {
CvPoint center;