[Bug 722158] New: facedetect element non-functional

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Mon Jan 13 22:23:37 PST 2014


https://bugzilla.gnome.org/show_bug.cgi?id=722158
  GStreamer | gst-plugins-bad | 1.2.4

           Summary: facedetect element non-functional
    Classification: Platform
           Product: GStreamer
           Version: 1.2.4
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-bad
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: kcannon at cita.utoronto.ca
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Created an attachment (id=266229)
 View: https://bugzilla.gnome.org/attachment.cgi?id=266229
 Review: https://bugzilla.gnome.org/review?bug=722158&attachment=266229

disable maximum object size restriction

Some time ago I found that the facedetect element had stopped finding faces in
my videos.  I don't know when, exactly, this happened, but the problem hasn't
resolved itself and I was finally motivated to see if I could figure out why. 
I think I've identified the cause, or at least I have a patch that fixes it for
me locally.

The gst_face_detect_run_detector() function includes an #if/#endif block that
adds an extra argument to the cvHaarDetectObjects() call if the libopencv
version is >= 2.2.  Checking the documentation at
http://docs.opencv.org/modules/objdetect/doc/cascade_classification.html that
final argument is described as "maxSize – Maximum possible object size. Objects
larger than that are ignored".  The gstreamer facedetect element sets this
argument to

cvSize (min_size_width + 2, min_size_height + 2)

i.e., it hard-codes it to 2 pixels larger in width and height than the minimum
object size.  This seems to explain why the element can't find faces:  unless
the user sets the minimum object size to within a few pixels of the actual size
of the faces in the video they will not be found.

I have experimented and found that setting this parameter (0,0) seems to
disable the max object size restriction, allowing faces to be detected once
again.  This is not documented in the libopencv documentation, so who knows,
but I've attached a patch that makes this change.

Note that faceblur hard-codes the maximum object size to 32x32 and also fails
to find faces in my videos (which are recorded at 640x480).  I recommend
setting the parameter to 0x0 in that element as well.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list